code: public static void close(ResultSet rs) {
  		Statement st = null;
  		Connection con = null;
  		try {
  			try {
  				if (rs != null) {
  					st = rs.getStatement();
  					rs.close();
  				}
  			} finally {
  				try {
  					if (st != null) {
  						con = st.getConnection();
  						st.close();
  					}
  				} finally {
  					if (con != null) {
  						con.close();
  					}
  				}
  			}
  		} catch (SQLException e) {
  			e.printStackTrace();
  		}
  	}
docs: Close connection
  
  @param rs