Class AlterDB


  • public final class AlterDB
    extends ACreate
    Evaluates the 'alter database' command and renames a database.
    Author:
    BaseX Team 2005-24, BSD License, Christian Gruen
    • Constructor Detail

      • AlterDB

        public AlterDB​(String db,
                       String name)
        Default constructor.
        Parameters:
        db - database
        name - new name
    • Method Detail

      • 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
      • addLocks

        public void addLocks()
        Description copied from class: Job
        Collects lock strings (databases, special identifiers) when registering a query.
        Overrides:
        addLocks in class ACreate
      • alter

        public static boolean alter​(String source,
                                    String target,
                                    StaticOptions sopts)
        Renames the specified database.
        Parameters:
        source - name of the existing database
        target - new database name
        sopts - static options
        Returns:
        success flag
      • 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
      • 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