code: public static void close(@Nullable Connection con) throws SQLException {
  		if (con != null && !con.isClosed()) {
  			if (!con.getAutoCommit()) {
  				con.rollback();
  				con.setAutoCommit(true);
  			}
  			con.close();
  		}
  	}
docs: If the connection is not in {@link Connection#getAutoCommit() auto-commit mode}, roll it back
  and put it in auto-commit mode before closing the connection.
  
  @param con
  may be null