Skip to content

Commit d4ae61b

Browse files
authored
Merge pull request #120 from Dokyeongyun/develop
Develop
2 parents 20aeab9 + be7eb7e commit d4ae61b

File tree

8 files changed

+718
-467
lines changed

8 files changed

+718
-467
lines changed

pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
<version>11.2.0.4</version>
2020
</dependency>
2121

22-
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-configuration2 -->
22+
<!-- commons-configuration2 -->
2323
<dependency>
2424
<groupId>org.apache.commons</groupId>
2525
<artifactId>commons-configuration2</artifactId>
26-
<version>2.4</version>
26+
<version>2.7</version>
2727
</dependency>
2828

29-
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
29+
<!-- commons-beanutils -->
3030
<dependency>
3131
<groupId>commons-beanutils</groupId>
3232
<artifactId>commons-beanutils</artifactId>
33-
<version>1.9.3</version>
33+
<version>1.9.4</version>
3434
</dependency>
3535

3636
<!-- https://mvnrepository.com/artifact/com.jcraft/jsch -->
@@ -61,11 +61,11 @@
6161
<version>2.6</version>
6262
</dependency>
6363

64-
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
64+
<!-- Guava -->
6565
<dependency>
6666
<groupId>com.google.guava</groupId>
6767
<artifactId>guava</artifactId>
68-
<version>21.0</version>
68+
<version>30.1.1-jre</version>
6969
</dependency>
7070

7171
<!-- https://mvnrepository.com/artifact/com.opencsv/opencsv -->
@@ -79,28 +79,28 @@
7979
<dependency>
8080
<groupId>org.apache.poi</groupId>
8181
<artifactId>poi</artifactId>
82-
<version>3.14</version>
82+
<version>3.17</version>
8383
</dependency>
8484

8585
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-schemas -->
8686
<dependency>
8787
<groupId>org.apache.poi</groupId>
8888
<artifactId>poi-ooxml-schemas</artifactId>
89-
<version>3.14</version>
89+
<version>3.17</version>
9090
</dependency>
9191

9292
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-scratchpad -->
9393
<dependency>
9494
<groupId>org.apache.poi</groupId>
9595
<artifactId>poi-scratchpad</artifactId>
96-
<version>3.14</version>
96+
<version>3.17</version>
9797
</dependency>
9898

9999
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
100100
<dependency>
101101
<groupId>org.apache.poi</groupId>
102102
<artifactId>poi-ooxml</artifactId>
103-
<version>3.14</version>
103+
<version>3.17</version>
104104
</dependency>
105105

106106
<!-- JavaFX UI -->

src/main/java/Root/common/database/implement/JdbcDatabase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public boolean rollback(Connection conn) {
110110
* @param validationQuery the query to be executed with the connection
111111
* @return 1 if valid, else return -1
112112
*/
113-
public boolean validateConn(Connection conn, String validationQuery) {
113+
public static boolean validateConn(Connection conn, String validationQuery) {
114114
if (conn == null) {
115115
return false;
116116
}

src/main/java/Root/core/domain/JdbcConnectionInfo.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,19 @@ public class JdbcConnectionInfo {
2121
private String jdbcHost;
2222
private String jdbcPort;
2323
private String jdbcOracleDriver;
24-
25-
public JdbcConnectionInfo(String jdbcDBName, String jdbcDriver, String jdbcUrl, String jdbcId, String jdbcPw, String jdbcValidation, int jdbcConnections) {
24+
25+
public JdbcConnectionInfo(String jdbcDriver, String jdbcUrl, String jdbcId, String jdbcPw, String jdbcValidation,
26+
int jdbcConnections) {
27+
this.jdbcDriver = jdbcDriver;
28+
this.jdbcUrl = jdbcUrl;
29+
this.jdbcId = jdbcId;
30+
this.jdbcPw = jdbcPw;
31+
this.jdbcValidation = jdbcValidation;
32+
this.jdbcConnections = jdbcConnections;
33+
}
34+
35+
public JdbcConnectionInfo(String jdbcDBName, String jdbcDriver, String jdbcUrl, String jdbcId, String jdbcPw,
36+
String jdbcValidation, int jdbcConnections) {
2637
this.jdbcDBName = jdbcDBName;
2738
this.jdbcDriver = jdbcDriver;
2839
this.jdbcUrl = jdbcUrl;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package root.javafx.Service;
2+
3+
import javafx.concurrent.Service;
4+
import javafx.concurrent.Task;
5+
import javafx.scene.control.Alert.AlertType;
6+
import root.common.database.implement.JdbcDatabase;
7+
import root.core.domain.JdbcConnectionInfo;
8+
import root.utils.AlertUtils;
9+
10+
public class DatabaseConnectService extends Service<Boolean> {
11+
12+
public static final String SUCCESS_MSG = "데이터베이스가 성공적으로 연동되었습니다.\n URL: %s \n Driver: %s";
13+
public static final String FAIL_MSG = "데이터베이스 연동에 실패했습니다.\n URL: %s \n Driver: %s";
14+
15+
private JdbcConnectionInfo jdbc;
16+
private JdbcDatabase db;
17+
18+
public DatabaseConnectService(JdbcConnectionInfo jdbc) {
19+
this.jdbc = jdbc;
20+
this.db = new JdbcDatabase(jdbc);
21+
}
22+
23+
@Override
24+
protected Task<Boolean> createTask() {
25+
return new Task<Boolean>() {
26+
@Override
27+
protected Boolean call() throws Exception {
28+
db.init();
29+
boolean isConn = JdbcDatabase.validateConn(db.getConn(), jdbc.getJdbcValidation());
30+
if (!isConn) {
31+
throw new Exception("Database connection test Failed");
32+
}
33+
return isConn;
34+
}
35+
};
36+
}
37+
}

src/main/java/Root/utils/DBManageExcel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public static void createMonthlyReportInExcel(int year, int month) {
3333

3434
// CellStyle 생성
3535
// 1. 회색 배경, 검은색 실선 테두리, 중앙정렬
36-
XSSFCellStyle grayCS = excel.createCellStyle("d0cece", (short) 0);
36+
XSSFCellStyle grayCS = excel.createCellStyle("d0cece", false);
3737
// 2. 회색 배경, 검은색 실선 테두리, 왼쪽정렬
38-
XSSFCellStyle grayCSLeft = excel.createCellStyle("d0cece", (short) 0);
38+
XSSFCellStyle grayCSLeft = excel.createCellStyle("d0cece", false);
3939
grayCSLeft.setAlignment(HorizontalAlignment.LEFT);
4040
// 3. 흰색 배경, 검은색 실선 테두리, 중앙정렬
41-
XSSFCellStyle whiteCS = excel.createCellStyle("ffffff", (short) 0);
41+
XSSFCellStyle whiteCS = excel.createCellStyle("ffffff", false);
4242
// 4. 흰색 배경, 검은색 실선 테두리, 왼쪽정렬
43-
XSSFCellStyle whiteCSLeft = excel.createCellStyle("ffffff", (short) 0);
43+
XSSFCellStyle whiteCSLeft = excel.createCellStyle("ffffff", false);
4444
whiteCSLeft.setAlignment(HorizontalAlignment.LEFT);
4545

4646
// Write Header Region

0 commit comments

Comments
 (0)