Package org.h2.tools

Class DeleteDbFiles

java.lang.Object
org.h2.util.Tool
org.h2.tools.DeleteDbFiles

public class DeleteDbFiles extends Tool
Deletes all files belonging to a database. The database must be closed before calling this tool.
  • Constructor Details

    • DeleteDbFiles

      public DeleteDbFiles()
  • Method Details

    • main

      public static void main(String... args) throws SQLException
      Options are case sensitive.
      Supported options
      [-help] or [-?] Print the list of options
      [-dir <dir>] The directory (default: .)
      [-db <database>] The database name
      [-quiet] Do not print progress information
      Parameters:
      args - the command line arguments
      Throws:
      SQLException - on failure
    • runTool

      public void runTool(String... args) throws SQLException
      Description copied from class: Tool
      Run the tool with the given output stream and arguments.
      Specified by:
      runTool in class Tool
      Parameters:
      args - the argument list
      Throws:
      SQLException - on failure
    • execute

      public static void execute(String dir, String db, boolean quiet)
      Deletes the database files.
      Parameters:
      dir - the directory
      db - the database name (null for all databases)
      quiet - don't print progress information
    • process

      private void process(String dir, String db, boolean quiet)
      Deletes the database files.
      Parameters:
      dir - the directory
      db - the database name (null for all databases)
      quiet - don't print progress information
    • process

      private static void process(String fileName, boolean quiet)