org.apache.ddlutils.task
Class DatabaseCommand

java.lang.Object
  extended byorg.apache.ddlutils.task.DatabaseCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
ConvertingDatabaseCommand, CreateDatabaseCommand, DatabaseCommandWithCreationParameters, DropDatabaseCommand

public abstract class DatabaseCommand
extends Object
implements Command

Base type for commands that have the database info embedded.

Version:
$Revision: 289996 $
Author:
Thomas Dudziak

Constructor Summary
DatabaseCommand()
           
 
Method Summary
protected  String getDatabaseType()
          Returns the database type.
protected  org.apache.commons.dbcp.BasicDataSource getDataSource()
          Returns the data source to use for accessing the database.
protected  Platform getPlatform()
          Creates the platform for the configured database.
 boolean isFailOnError()
          Determines whether the command execution will be stopped upon an error.
 boolean isRequiringModel()
          Specifies whether this command requires a model, i.e. whether the second argument in Command.execute(Task, Database) cannot be null.
 void setFailOnError(boolean failOnError)
          Specifies whether the command execution will be stopped upon an error.
protected  void setPlatformConfiguration(PlatformConfiguration platformConf)
          Sets the platform configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ddlutils.task.Command
execute
 

Constructor Detail

DatabaseCommand

public DatabaseCommand()
Method Detail

getDatabaseType

protected String getDatabaseType()
Returns the database type.

Returns:
The database type

getDataSource

protected org.apache.commons.dbcp.BasicDataSource getDataSource()
Returns the data source to use for accessing the database.

Returns:
The data source

setPlatformConfiguration

protected void setPlatformConfiguration(PlatformConfiguration platformConf)
Sets the platform configuration.

Parameters:
platformConf - The platform configuration

isFailOnError

public boolean isFailOnError()
Determines whether the command execution will be stopped upon an error. Default value is true.

Returns:
true if the execution stops in case of an error

setFailOnError

public void setFailOnError(boolean failOnError)
Specifies whether the command execution will be stopped upon an error.

Parameters:
failOnError - true if the execution stops in case of an error

getPlatform

protected Platform getPlatform()
                        throws org.apache.tools.ant.BuildException
Creates the platform for the configured database.

Returns:
The platform
Throws:
org.apache.tools.ant.BuildException

isRequiringModel

public boolean isRequiringModel()
Specifies whether this command requires a model, i.e. whether the second argument in Command.execute(Task, Database) cannot be null.

Specified by:
isRequiringModel in interface Command
Returns:
true if this command requires a model


Copyright © 2005 Apache Software Foundation. All Rights Reserved.