Code:
Transaction t2 = null;
String log2Data = null;
Connection con = null;
ResultSet rs = null;
PreparedStatement ps = null;
session2 = HibernateUtil.getSessionFactory().openSession();
try{
t2 = session2.beginTransaction();
con = session2.connection();
rs = con.prepareStatement( "select........").executeQuery();
.......
t2.commit();
}catch(Exception e){
...........
}
finally{
try {
if( ps != null) ps.close();
... rs.close();
... con.close();
} catch (SQLException e) {
.........
}
session2.close();
}
In above code, ps.close/rs.close/con.close need?
Or, only session2.close is ok?
Thanks in advance!