是必须要删除的!!
         以删除记录为例:
String sql = "delete from {tablename} where {<search_condition>}"; Connection con = null;
PreparedStatement stmt = null;
try {
con=getConnection();
stmt = con.prepareStatement(sql);
         stmt.executeUpdate();
}
finally {
try {
if (stmt != null) {
stmt.close();
}
}catch (Exception e) {}
try {
if (con != null) {
con.close();
}
}catch (Exception e) {}
}

解决方案 »

  1.   

    根据Sun的Blueprint,数据库资源需要及时的回收,因此不仅是数据库,连接,就连ResultSet都需要。
      

  2.   

    其实可以这么说,除了内存之外的资源都必须由程序员亲自来控制,所以使用后关闭连接是必须的(当然如果做连接池就是另外一回事了,呵呵),另外,象file,socket等也都需要手动关闭