Commit 9401114e authored by 刘喆's avatar 刘喆

java gc close ps

parent 24000c60
...@@ -79,8 +79,7 @@ public class MysqlJdbcDim { ...@@ -79,8 +79,7 @@ public class MysqlJdbcDim {
st.executeUpdate(sql); st.executeUpdate(sql);
} }
public ResultSet query(String sql, List<Object> param) { public ResultSet query(String sql, List<Object> param) throws SQLException {
Statement st = null;
PreparedStatement ps = null; PreparedStatement ps = null;
ResultSet rs = null; ResultSet rs = null;
try { try {
...@@ -96,6 +95,8 @@ public class MysqlJdbcDim { ...@@ -96,6 +95,8 @@ public class MysqlJdbcDim {
rs = ps.executeQuery(); rs = ps.executeQuery();
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} finally {
ps.close();
} }
return rs; return rs;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment