From 43e3e7c80cb0d020dd9a78db54218685d8b11a54 Mon Sep 17 00:00:00 2001 From: chenlw <874313221@qq.com> Date: Sun, 19 Feb 2017 11:27:46 +0800 Subject: [PATCH] =?UTF-8?q?statement.close();=E5=85=B3=E9=97=AD=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E7=9A=84=E6=B8=B8=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/platform/oracle/OracleConnector.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/com/platform/oracle/OracleConnector.java b/src/com/platform/oracle/OracleConnector.java index 49c3b9f5..ddfc9936 100644 --- a/src/com/platform/oracle/OracleConnector.java +++ b/src/com/platform/oracle/OracleConnector.java @@ -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;