ResultSet is a return value, it is difficult to determine when it will be closed.
ResultSet executeQuery (String sql) {CachedRowSet rowSet = new CachedRowSet (); ResultSet rs = null; Connection conn = null; Statement stmt = null; try {// database operations rowSet.populate (rs);} cacth (SQLException e) { } Finally {// Turn off all database resources, except RowSet} Return RowSet;}