uk.org.ogsadai.client.toolkit.activity.sql
Class SQLDropDatabase

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
        |
        +--uk.org.ogsadai.client.toolkit.activity.Activity
              |
              +--uk.org.ogsadai.client.toolkit.activity.sql.SQLDropDatabase

public class SQLDropDatabase
extends Activity

This activity drops a relational database. This activity has no inputs and one output. The output is specific to the data resource's DMBS.

Author:
The OGSA-DAI Project Team

Constructor Summary
SQLDropDatabase(java.lang.String databaseName)
          Constructs an SQL drop database activity that will drop the specified database
 
Method Summary
protected  java.lang.String generateXML()
          Generates the XML representing the activity.
 int getCount()
          Gets the count returned by DBMS from the DROP DATABASE statement.
 java.lang.String getDatabaseName()
          Gets the name of the database to be dropped.
 ActivityOutput getOutput()
          Gets the activity's only output.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity
addInput, addOutput, addOutputs, getDataResourceID, getDataServiceStub, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setDataServiceStub, setInput
 
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLDropDatabase

public SQLDropDatabase(java.lang.String databaseName)
Constructs an SQL drop database activity that will drop the specified database

Parameters:
databaseName - Name of database to be dropped
Method Detail

getDatabaseName

public java.lang.String getDatabaseName()
Gets the name of the database to be dropped.

Returns:
Database name

getCount

public int getCount()
             throws ActivityOutputException,
                    DataFormatException
Gets the count returned by DBMS from the DROP DATABASE statement.

What this value represents is dependent on the DBMS used by the data resource.

In MySQL this value is number of files that were removed from the database directory. Normally, this is three times the number of tables.

Returns:
count returned by the DBMS for the DROP DATABASE statement
Throws:
ActivityOutputException - When the activity output has no data.
DataFormatException - If the activity output is not in 'update count' format. This may occur with DBMSs that do not return a numerical value from a DROP DATABASE statement

getOutput

public ActivityOutput getOutput()
Gets the activity's only output. This output respresents the result returned by the data resource's DBMS when the DROP DATABASE SQL statement is executed.

This result may differ depending on the DBMS.

For the MySQL DBMS the result is the number of files that were removed from the database directory. Normally, this is three times the number of tables.

Returns:
the activity output

generateXML

protected java.lang.String generateXML()
Description copied from class: RequestComponent
Generates the XML representing the activity. This XML can then be inserted into a perform document that is sent to a data service.

Specified by:
generateXML in class Activity
Returns:
the XML for the activity