code: public static synchronized void closeAllInTransaction(
          org.opencms.db.generic.CmsSqlManager sqlManager,
          CmsDbContext dbc,
          Connection con,
          PreparedStatement stmnt,
          ResultSet res,
          PreparedStatement commit,
          boolean wasInTransaction) {
  
          if (dbc == null) {
              LOG.error(Messages.get().getBundle().key(Messages.LOG_NULL_DB_CONTEXT_0));
          }
  
          if (res != null) {
              try {
                  res.close();
              } catch (SQLException exc) {
                  // ignore
                  if (LOG.isDebugEnabled()) {
                      LOG.debug(exc.getLocalizedMessage(), exc);
                  }
              }
          }
          if (commit != null) {
              try {
                  commit.close();
              } catch (SQLException exc) {
                  // ignore
                  if (LOG.isDebugEnabled()) {
                      LOG.debug(exc.getLocalizedMessage(), exc);
                  }
              }
          }
          if (!wasInTransaction) {
              if (stmnt != null) {
                  try {
                      PreparedStatement rollback = sqlManager.getPreparedStatement(con, "C_ROLLBACK");
                      rollback.execute();
                      rollback.close();
                  } catch (SQLException se) {
                      // ignore
                      if (LOG.isDebugEnabled()) {
                          LOG.debug(se.getLocalizedMessage(), se);
                      }
                  }
                  try {
                      stmnt.close();
                  } catch (SQLException exc) {
                      // ignore
                      if (LOG.isDebugEnabled()) {
                          LOG.debug(exc.getLocalizedMessage(), exc);
                      }
                  }
              }
              if (con != null) {
                  try {
                      con.setAutoCommit(true);
                      con.close();
                  } catch (SQLException se) {
                      // ignore
                      if (LOG.isDebugEnabled()) {
                          LOG.debug(se.getLocalizedMessage(), se);
                      }
                  }
              }
          }
      }
docs: Attempts to close the connection, statement and result set after a statement has been executed.<p>
  
  @param sqlManager the sql manager to use
  @param dbc the current database context
  @param con the JDBC connection
  @param stmnt the statement
  @param res the result set
  @param commit the additional statement for the 'commit' command
  @param wasInTransaction if using transactions