|
|
@ -3,6 +3,7 @@ package com.platform.service;
|
|
|
|
import java.sql.Connection;
|
|
|
|
import java.sql.Connection;
|
|
|
|
import java.sql.ResultSet;
|
|
|
|
import java.sql.ResultSet;
|
|
|
|
import java.sql.SQLException;
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
|
|
|
import java.sql.Statement;
|
|
|
|
|
|
|
|
|
|
|
|
import com.base.Custom4exception;
|
|
|
|
import com.base.Custom4exception;
|
|
|
|
import com.base.CustomException;
|
|
|
|
import com.base.CustomException;
|
|
|
@ -183,4 +184,21 @@ public class OracleExtractHelper {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 测试是否能否连接上?
|
|
|
|
|
|
|
|
* @return true:能连接上
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public boolean testConnect(Connection conn) {
|
|
|
|
|
|
|
|
String testSql = "select count(*) from user_tables";
|
|
|
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Statement statement = conn.createStatement();
|
|
|
|
|
|
|
|
if(statement.executeUpdate(testSql) > 0)
|
|
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
flag = false;
|
|
|
|
|
|
|
|
new CustomException(Custom4exception.OracleSQL_Except, e, testSql);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return flag;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|