|
@@ -14,6 +14,7 @@ import javax.annotation.PostConstruct;
|
|
|
import java.sql.*;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Properties;
|
|
|
|
|
|
@Slf4j
|
|
|
@AllArgsConstructor
|
|
@@ -91,11 +92,15 @@ public class DbSvrSttsJobThread {
|
|
|
Connection conn = null;
|
|
|
try {
|
|
|
Class.forName(this.JDBC_DRIVER);
|
|
|
+ DriverManager.setLoginTimeout(10);
|
|
|
+ Properties properties = new Properties();
|
|
|
+ properties.put("connectTimeout", "2000");
|
|
|
conn = DriverManager.getConnection(dbUrl, this.username, this.password);
|
|
|
|
|
|
String TBLS_NM = "";
|
|
|
double TBLS_RMND_CPCT = 100.0;
|
|
|
PreparedStatement stmt1 = conn.prepareStatement(sql1);
|
|
|
+ stmt1.setQueryTimeout(10);
|
|
|
ResultSet rs1 = stmt1.executeQuery();
|
|
|
while(rs1.next()) {
|
|
|
String tblsNm = rs1.getString("TBLS_NM");
|
|
@@ -111,6 +116,7 @@ public class DbSvrSttsJobThread {
|
|
|
stmt1.close();
|
|
|
|
|
|
PreparedStatement stmt2 = conn.prepareStatement(sql2);
|
|
|
+ stmt2.setQueryTimeout(10);
|
|
|
ResultSet rs2 = stmt2.executeQuery();
|
|
|
while(rs2.next()) {
|
|
|
Double useSesn = rs2.getDouble("USE_SESN");
|
|
@@ -120,12 +126,12 @@ public class DbSvrSttsJobThread {
|
|
|
stmt2.close();
|
|
|
}
|
|
|
catch(SQLException e) {
|
|
|
- log.error("executeDbSvrStts: SQLException, {}, {}", db.getDbSvrIp(), e.getMessage());
|
|
|
- throw new RuntimeException(e.getMessage(), e);
|
|
|
+ log.error("executeDbSvrStts: SQLException, {}, {}, {}", dbUrl, db.getDbSvrIp(), e.getMessage());
|
|
|
+ throw new RuntimeException(dbUrl + e.getMessage(), e);
|
|
|
}
|
|
|
catch (ClassNotFoundException e) {
|
|
|
- log.error("executeDbSvrStts: ClassNotFoundException, {}, {}", db.getDbSvrIp(), e.getMessage());
|
|
|
- throw new RuntimeException(e.getMessage(), e);
|
|
|
+ log.error("executeDbSvrStts: ClassNotFoundException, {}, {}, {}", dbUrl, db.getDbSvrIp(), e.getMessage());
|
|
|
+ throw new RuntimeException(dbUrl + e.getMessage(), e);
|
|
|
}
|
|
|
finally {
|
|
|
if (conn != null) {
|