2004.04.29


com.jdc.rdb.sql.ddl
Class DDL

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.rdb.sql.SQL
              |
              +--com.jdc.rdb.sql.ddl.DDL
All Implemented Interfaces:
Serializable, Statement
Direct Known Subclasses:
Alter, Create, Drop

public abstract class DDL
extends SQL

DDL represents a Data Definition Language (DDL) statement. This class is the superclass for all DDL Structured Query Language (SQL) statement classes.

The following Data Definition Language statements are supported:

Note:
The DDL class is declared abstract and cannot be instantiated.

Version:
2.0
Author:
Jay Damon
See Also:
Create, Alter, Drop, Serialized Form

Field Summary
protected  SQLHelper sql
          The SQL helper object for this DDL statement.
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
protected DDL(String command)
          Constructs a new DDL statement object for the specified SQL command.
protected DDL(String command, Object object)
          Constructs a new DDL statement object for the specified SQL command Database Object.
 
Method Summary
protected  void finalize()
          Ensures the DDL statement Database Connection is closed when called by the garbage collector.
 Connection getConnection()
          Returns the Database Connection to use to execute the DDL statement.
protected  Database getDatabase()
          Returns the Database definition for this DDL statement.
 Object getObject()
          Returns the Database Object for this DDL statement.
protected  boolean isValid()
          Returns true if the DDL statement is valid.
 DDL setObject(Object object)
          Sets the Database Object for this DDL statement.
 
Methods inherited from class com.jdc.rdb.sql.SQL
addClause, execute, getClause, getCommand, getStatement, setCommand, setConnection, setStatement, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sql

protected final SQLHelper sql
The SQL helper object for this DDL statement.

Constructor Detail

DDL

protected DDL(String command)
Constructs a new DDL statement object for the specified SQL command.

Throws:
SQLInvalidException - No DDL command is specified.

DDL

protected DDL(String command,
              Object object)
Constructs a new DDL statement object for the specified SQL command Database Object.

Throws:
SQLInvalidException - No DDL command is specified, no database object is specified, or the object type is not valid.
Method Detail

finalize

protected void finalize()
Ensures the DDL statement Database Connection is closed when called by the garbage collector.

Overrides:
finalize in class SQL

getConnection

public Connection getConnection()
Returns the Database Connection to use to execute the DDL statement. If no Database Connection is specified, this class obtains a Connection from the Database Schema or Table definition.

Overrides:
getConnection in class SQL
Returns:
The Database Connection to use.

getDatabase

protected Database getDatabase()
Returns the Database definition for this DDL statement.

Returns:
The Database definition.

getObject

public Object getObject()
Returns the Database Object for this DDL statement.

Returns:
The Database Object.

setObject

public DDL setObject(Object object)
Sets the Database Object for this DDL statement.

Returns:
This DDL statement object.
Throws:
SQLInvalidException - No database object is specified or the object type is not valid.

isValid

protected boolean isValid()
Returns true if the DDL statement is valid.

Overrides:
isValid in class SQL
Returns:
True if the SQL statement is valid.
False if the SQL statement is not valid

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.