2004.04.29


com.jdc.rdb.sql.dml
Class DML

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.rdb.sql.SQL
              |
              +--com.jdc.rdb.sql.dml.DML
All Implemented Interfaces:
Serializable, Statement
Direct Known Subclasses:
Delete, Insert, Select, Update

public abstract class DML
extends SQL

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

The following Data Manipulation Language statements are supported:

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

Version:
2.0
Author:
Jay Damon
See Also:
Select, Insert, Update, Delete, Serialized Form

Field Summary
protected  SQLHelper sql
          The SQL helper object for this DML statement.
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
protected DML(String command)
          Constructs a new DML statement object for the specified SQL command.
protected DML(String command, Table table)
          Constructs a new DML statement object for the specified SQL command Database Table definition.
 
Method Summary
protected  void finalize()
          Ensures the DML statement Database Connection is closed when called by the garbage collector.
protected  Column getColumn(Column column, String method)
          Returns the actual Table Column definition for the specified Column definition.
 Connection getConnection()
          Returns the Database Connection to use to execute the DML statement.
 Table getTable()
          Returns the Database Table definition for this DML statement.
 DML setTable(Table table)
          Sets the Database Table definition for this DML statement.
 
Methods inherited from class com.jdc.rdb.sql.SQL
addClause, execute, getClause, getCommand, getStatement, isValid, 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 DML statement.

Constructor Detail

DML

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

Throws:
SQLInvalidException - No DML command is specified.

DML

protected DML(String command,
              Table table)
Constructs a new DML statement object for the specified SQL command Database Table definition.

Throws:
SQLInvalidException - No DML command is specified or no database, schema, or table definition is specified.
Method Detail

finalize

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

Overrides:
finalize in class SQL

getColumn

protected Column getColumn(Column column,
                           String method)
Returns the actual Table Column definition for the specified Column definition. The calling method name may also be specified (to isolate exceptions).

Returns:
The Table Column definition.
Throws:
SQLInvalidException - No column is specified or an invalid table column is specified.

getConnection

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

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

getTable

public Table getTable()
Returns the Database Table definition for this DML statement.

Returns:
The Database Table definition.

setTable

public DML setTable(Table table)
Sets the Database Table definition for this DML statement.

Returns:
This DML statement object.
Throws:
SQLInvalidException - No table definition is specified.

2004.04.29



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