Tuesday, March 18, 2008

proper close of JDBC Connection

Wrong way to close the connection object:
 
        Connection con = ds.getConnection();
         ....
         ....
         ....
         con = null;
 
Right way:
    Connection con = ds.getConnection();
      .....
      .....
      .....
      con.close();
      con = null;
 
 

No comments: