Class DropDB


public final class DropDB extends ACreate
Evaluates the 'drop database' command and deletes a database.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • DropDB

      public DropDB(String name)
      Default constructor.
      Parameters:
      name - name of database
  • Method Details

    • run

      protected boolean run()
      Description copied from class: Command
      Executes the command and serializes the result (internal call).
      Specified by:
      run in class Command
      Returns:
      success of operation
    • drop

      public static boolean drop(Data data, StaticOptions sopts)
      Deletes the specified database. Calls for main-memory database instances are ignored.
      Parameters:
      data - data reference
      sopts - static options
      Returns:
      success flag
    • drop

      public static boolean drop(String db, StaticOptions sopts)
      Deletes the specified database.
      Parameters:
      db - name of the database
      sopts - static options
      Returns:
      success flag
    • drop

      public static boolean drop(IOFile path, String pat)
      Recursively drops files in database directory with the specified pattern.
      Parameters:
      path - database path
      pat - file pattern
      Returns:
      success of operation
    • newData

      public boolean newData(Context ctx)
      Description copied from class: Command
      Closes an open data reference and returns true if this command will change the Context.data() reference. This method is only required by the GUI.
      Overrides:
      newData in class ACreate
      Parameters:
      ctx - database context
      Returns:
      result of check
    • addLocks

      public void addLocks()
      Description copied from class: Job
      Adds the strings (databases, special identifiers) for which locks need to be acquired.
      Overrides:
      addLocks in class ACreate
    • build

      public void build(CmdBuilder cb)
      Description copied from class: Command
      Builds a string representation from the command. This string must be correctly built, as commands are sent to the server as strings.
      Overrides:
      build in class Command
      Parameters:
      cb - command builder