Closing PreparedStatements
问题 Does use of PreparedStatements and ResultSets creates a "new database instance" everytime they are used? Or, whith other words, if I use a PreparedStatement and a ResultSet, should I close them after every use or once I finish? Example: while (...){ p = connection.prepareStatement(...); r = p.executeQuery(); while (r.next()) { .... } } // We close at the end. Or there are any other p and r still opened...? p.close(); r.close(); OR while (...){ p = connection.prepareStatement(...); r = p