我试图通过关闭它并在 finally 块中将值设置为 null来释放JDBC ResultSet使用的空间。前任:
try{
//some query executed here and resultset used to get the values from the db
}catch(Exception exp){
//log exception here
}finally{
//close resultset
if(rs != null){
rs.close();
rs = null;
}
}
当我检查YourKit中打开的 ResultSet 的数量时,即使所有结果集都已关闭并设置为 null,而不是显示 0 结果集 open YourKit 显示打开结果集的一些非零值。任何人都可以在这里帮助我使打开结果集的数量为 0。
提前致谢。坦马伊