On reading the javadoc, it is mentioned that:
A ResultSet object is automatically closed by the Statement object that
generated it when that Statement object is closed, re-executed, or is used to
retrieve the next result from a sequence of multiple results.
Thus I don't close the ResultSet anymore.
To solve the problem, Connection needs to be closed prior to Statements.
e.g. This does not throw any SQLException
finally
{
try
{
conn.close();
statement.close();
}
catch( SQLException sqle )
{
...
}
}