Is it necessary to close a ResultSet and PreparedStatement at the end of
some JDBC code before closing the Connection or are they closed
automatically by closing the database connection?  

For example is this ok?

Connection conn = DbPool.getConnection();
ResultSet rs = null;
PreparedStatement = null;
.
.
.
conn.close();


Or should I do this?

Connection conn = DbPool.getConnection();
ResultSet rs = null;
PreparedStatement = null;
.
.
.
rs.close();
stmnt.close();
conn.close();



T O N Y  S P E N C E R
Notsleepy LLC
6512 Six Forks Rd.
Suite 502-B 
Raleigh, NC 27615
Phone: 919.848.0691
Mobile: 415.637.6481
[EMAIL PROTECTED] 

 


_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to