Authored by 宋文圆

修改getKPISet()中捕获异常的方法

... ... @@ -189,31 +189,22 @@ public class SQLTarget extends CollBase {
Vector recordSet = new Vector();
PreparedStatement pstmt = null;
ResultSet result = null;
if (!getState()) {
return recordSet;
}
try {
pstmt = dbConnection.prepareStatement(sql);
} catch (SQLException e) {
throw new RuntimeException("Exception while exec sql :" + sql, e);
}
if (!getState()) {
return recordSet;
}
boolean hasResult = false;
try {
hasResult = pstmt.execute();
} catch (SQLException e) {
logger.error("pstmt.execute() has error!",e);
e.printStackTrace();
}
try {
pstmt = dbConnection.prepareStatement(sql);
//避免在采集9i数据库时,在CollOracleBySql.getTableSpaces()方法中无法执行catch里面的方法,
// 将此处的捕捉异常去掉,统一捕获异常 2017-5-25 swy(代码之前是没有在这里捕获异常的)
boolean hasResult = pstmt.execute();
if (hasResult) {
result = pstmt.getResultSet();
ResultSetMetaData rsmd = result.getMetaData();
int iColumnCount = rsmd.getColumnCount();
while (result.next()) {
Vector vTemp = new Vector();
java.util.Vector vTemp = new Vector();
for (int i = 0; i < iColumnCount; i++) {
Object oTemp = result.getObject(i + 1);
String sTemp = oTemp == null ? "" : oTemp.toString();
... ...