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

java gc close ps

parent 24000c60
......@@ -79,8 +79,7 @@ public class MysqlJdbcDim {
st.executeUpdate(sql);
}
public ResultSet query(String sql, List<Object> param) {
Statement st = null;
public ResultSet query(String sql, List<Object> param) throws SQLException {
PreparedStatement ps = null;
ResultSet rs = null;
try {
......@@ -96,6 +95,8 @@ public class MysqlJdbcDim {
rs = ps.executeQuery();
} catch (SQLException e) {
e.printStackTrace();
} finally {
ps.close();
}
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