关于怎样关闭Connection,ResultSet,PreparedStatement
方法1:try { if (rs != null) { rs.close(); } if (p != null) { p.close(); } if (connection != null) { connection.close(); } } catch (SQLException e) { e.printStackTrace(); }方法2:try { if (rs != null) { rs.close(); }} catch (SQLException e) { e.printStackTrace(); }Try{ if (p != null) { p.close(); }} catch (SQLException e) { e.printStackTrace(); }Try{ if (connection != null) { connection.close(); }} catch (SQLException e) { e.printStackTrace(); }