JDBC related question
Posted on 2006-10-19
If I use the same statement object and resultset object with more that one query like below
stmt = conn.prepareStatement(q1);
rs = stmt.executeQuery();
.......//do I have to close the resultSet and the statement Objects before using them again.
stmt = conn.prepareStatement(q2)
.......//close the same again in the same program?
My Question is if I want to use the same statement object and resultSet for more than one Query in the same program, do I have to close each time before using them again. If so, do I have to close the following each and every time in the program
2. Statement Object
3. Connection object