code: public static void cleanRepositoryData(RepositoryEntry rEntry) throws DBCleanException
     {
        SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
  
        WorkspaceEntry wsEntry = rEntry.getWorkspaceEntries().get(0);
  
        boolean multiDB = getMultiDbParameter(wsEntry);
        if (multiDB)
        {
           for (WorkspaceEntry entry : rEntry.getWorkspaceEntries())
           {
              cleanWorkspaceData(entry);
           }
        }
        else
        {
           Connection jdbcConn = getConnection(wsEntry);
           String dialect = resolveDialect(jdbcConn, wsEntry);
           boolean autoCommit = dialect.startsWith(DialectConstants.DB_DIALECT_SYBASE);
  
           try
           {
              jdbcConn.setAutoCommit(autoCommit);
  
              DBCleanerTool dbCleaner = getRepositoryDBCleaner(jdbcConn, rEntry);
              doClean(dbCleaner);
           }
           catch (SQLException e)
           {
              throw new DBCleanException(e);
           }
           finally
           {
              try
              {
                 jdbcConn.close();
              }
              catch (SQLException e)
              {
                 LOG.error("Can not close connection", e);
              }
           }
        }
     }
docs: Cleans repository data from database.
  
  @param rEntry
  the repository configuration
  @throws DBCleanException