请问在JSP中
Connection conn = null;
Statement stat = null;
ResultSet rs = null;
.......
if(rs != null) {
rs.close();
}
if(stat != null) {
stat.close();
}
if(conn != null) {
conn.close();
}
为什么要用if判断他是否为空?有什么作用?
请问在JSP中
Connection conn = null;
Statement stat = null;
ResultSet rs = null;
.......
if(rs != null) {
rs.close();
}
if(stat != null) {
stat.close();
}
if(conn != null) {
conn.close();
}
为什么要用if判断他是否为空?有什么作用?