code: static void closeQuietly(PreparedStatement ps) {
          try {
              boolean isClosed;
              try {
                  if (ps != null)
                      isClosed = ps.isClosed();
                  else
                      isClosed = true;
              } catch (SQLException e) {
                  log.debug(e.getMessage());
                  isClosed = true;
              }
              if (ps != null && !isClosed) {
                  try {
                      ps.cancel();
                      log.debug("cancelled {}", ps);
                  } catch (SQLException e) {
                      log.debug(e.getMessage());
                  }
                  ps.close();
                  log.debug("closed {}", ps);
              }
          } catch (SQLException e) {
              log.debug(e.getMessage(), e);
          } catch (RuntimeException e) {
              log.debug(e.getMessage(), e);
          }
      }
docs: Cancels then closes a {@link PreparedStatement} and logs exceptions
  without throwing. Does nothing if ps is null.
  
  @param ps