statement.close();关闭连接的游标

web_backend_develope
chenlw 8 years ago
parent 7bcc95e0d4
commit 43e3e7c80c

@ -72,6 +72,12 @@ public class OracleConnector {
}
}
/** 使 statement
* @param conn
* @param sql
* @param filePath
* @return
*/
public synchronized static ResultSet getSQLExecResultSet(Connection conn,
String sql, String filePath) {
ResultSet resultSet = null;
@ -105,6 +111,14 @@ public class OracleConnector {
return resultSet;
}
/** 使 statement
* @param url
* @param user
* @param password
* @param sql
* @param filePath
* @return
*/
public synchronized static ResultSet getSQLExecResultSet(String url,
String user, String password, String sql, String filePath) {
ResultSet result = null;
@ -138,6 +152,7 @@ public class OracleConnector {
flag = true;
FileOperateHelper.fileWrite(filePath + ".log", "执行结果:" + res
+ " \r\n");
statement.close();
} catch (SQLException e) {
flag = false;
FileOperateHelper.fileWrite(filePath + ".log",
@ -169,6 +184,7 @@ public class OracleConnector {
flag = true;
FileOperateHelper.fileWrite(filePath + ".log", "执行结果:"+ res
+ " \r\n");
statement.close();
} catch (SQLException e) {
flag = false;

Loading…
Cancel
Save