code: public static void close(Connection conn) {
          if (conn != null) {
              try {
                  conn.close();
              } catch (SQLException ex) {
                  logger.error("", ex);
              }
          }
      }
docs: Safely closes resources and logs errors.
  @param conn Connection to close