2004.04.29


com.jdc.rdb.tbl.tco
Class TableCreationObject

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.rdb.tbl.tco.TableCreationObject
Direct Known Subclasses:
ReferenceTableCreator

public class TableCreationObject
extends Object

TableCreationObject drops and/or creates a new database table given an input Table object. The database Table definition is used to create the required Data Definition Language (DDL) com.jdc.rdb.sql.ddl.Drop and/or com.jdc.rdb.sql.ddl.Create statements that are executed to drop and/or create the database table in the appropriate database and schema.

Multiple database tables may be dropped and/or created by first invoking the add method to add a given database table definition to a list of database tables. Once the list is created, drop and/or create the database tables by invoking the following methods (in order):

When dropping andcreating multiple database tables, it is recommended that all database tables be dropped first, then created.

Version:
1.0
Author:
Jay Damon
See Also:
Database, Table, Drop, Create

Field Summary
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
TableCreationObject()
          Constructs a new TableCreationObject object.
TableCreationObject(boolean execute)
          Constructs a new TableCreationObject object.
 
Method Summary
 void add(Table table)
          Adds a database Table definition to a list used to com.jdc.rdb.sql.ddl.Drop and/or com.jdc.rdb.sql.ddl.Create multiple database tables.
 boolean create(Table table)
          Creates a database Table by creating and executing a com.jdc.rdb.sql.ddl.Create SQL statement.
 boolean drop(Table table)
          Drops a database Table by creating and executing a com.jdc.rdb.sql.ddl.Drop SQL statement.
 boolean execute(String command)
          Executes com.jdc.rdb.sql.ddl.Drop or com.jdc.rdb.sql.ddl.Create SQL statements for multiple database Table definitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableCreationObject

public TableCreationObject()
Constructs a new TableCreationObject object.


TableCreationObject

public TableCreationObject(boolean execute)
Constructs a new TableCreationObject object. If the execute parameter is true, this table creation object will com.jdc.rdb.sql.ddl.Drop existing database tables and com.jdc.rdb.sql.ddl.Create new database tables. Otherwise, the SQL statements that would be executed are displayed to the console.

Method Detail

add

public void add(Table table)
Adds a database Table definition to a list used to com.jdc.rdb.sql.ddl.Drop and/or com.jdc.rdb.sql.ddl.Create multiple database tables.


create

public boolean create(Table table)
Creates a database Table by creating and executing a com.jdc.rdb.sql.ddl.Create SQL statement.


drop

public boolean drop(Table table)
Drops a database Table by creating and executing a com.jdc.rdb.sql.ddl.Drop SQL statement.


execute

public boolean execute(String command)
Executes com.jdc.rdb.sql.ddl.Drop or com.jdc.rdb.sql.ddl.Create SQL statements for multiple database Table definitions.


2004.04.29



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