com.ibm.dse.services.jdbc
Class Db2JournalSchemaGenerator

java.lang.Object
  |
  +--com.ibm.dse.services.jdbc.Db2JournalSchemaGenerator

public class Db2JournalSchemaGenerator
extends java.lang.Object


Field Summary
static boolean createSchema
          Deprecated.  
protected static java.sql.Connection databaseConnection
          Deprecated. Keeps the connection to the database that will be used by the Db2JournalSchemaGenerator
 int requestedNumberOfGenerations
          Deprecated. Keeps the number of generations for the journal schema
 java.lang.String requestedTableDefinition
          Deprecated. Keeps the journal tables definition in SQL format
 java.lang.String schemaName
          Deprecated. Keeps the journal schema name
 
Constructor Summary
Db2JournalSchemaGenerator()
          Deprecated. This constructor creates a Db2JournalSchemaGenerator object.
Db2JournalSchemaGenerator(java.lang.String aSchemaName)
          Deprecated. This constructor creates a Db2JournalSchemaGenerator object for the specified schema.
 
Method Summary
 void addEntity(java.lang.String anEntityName)
          Deprecated. Adds a new entity in the journal schema definition.
 Vector allEntities()
          Deprecated. Returns a vector with the entities defined for the current journal schema.
static Vector allEntities(java.lang.String aSchemaName)
          Deprecated. Returns a Vector with the entities names defined for the journal schema aSchemaName.
static void connect(java.lang.String aDatabaseURL)
          Deprecated. Connects to the database with URL aDatabaseURL.
static void connect(java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword)
          Deprecated. Connects to the database with the URL aDatabaseURL, user identification aUser, and password aPassword.
protected static java.lang.String controlTableName(java.lang.String aSchemaName)
          Deprecated. Returns the name of the control table for the schema name aSchemaName.
static DatabaseResultSetMetaData currentJournalTableColumnData(java.lang.String aSchemaName)
          Deprecated. Returns the DatabaseResultSetMetaData instance that contains the journal table columns information.
 java.lang.String currentJournalTableDefinition(java.lang.String aSchemaName)
          Deprecated. Calls the currentJournalTableColumnsData method to get the DatabaseResultSetMetaData instance for the schema aSchemaName.
static void disconnect()
          Deprecated. Closes the Database connection.
 void generateSchema(Vector aListOfEntities, int nbrOfGenerations, java.lang.String aTableDefinition)
          Deprecated. Generates the journal schema with a default database schema name (set in the JournalConstants class in attribute DEFAULT_SCHEMA_NAME).
 void generateSchema(Vector aListOfEntities, int nbrOfGenerations, java.lang.String aTableDefinition, java.lang.String aSchemaName)
          Deprecated. Generates the journal schema with name aSchemaName in the currently connected database.
static Vector generateSGML(java.lang.String aSchemaName, java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword)
          Deprecated. Called by the SGML editor tool if the information to create the journal format definition is to be retrieved from the database.
static Vector generateSGML(java.lang.String aSchemaName, java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword, java.lang.String aJDBCDriverName)
          Deprecated. Called by the SGML editor tool if the information to create the journal format definition is to be retrieved from the database.
protected static DatabaseResultSetMetaData getMetaData(java.lang.String aSchemaName)
          Deprecated. Returns the DatabaseResultSetMetaData instance associated with the schema aSchemaName.
 java.lang.String journalTableDefinition()
          Deprecated. Returns a string with the SQL definition of the journal tables columns.
 int numberOfGenerations()
          Deprecated. Returns the number of journal generations in the journal service definition.
static int numberOfGenerations(java.lang.String aSchemaName)
          Deprecated. Returns the number of journal generations for the schema aSchemaName.
 void removeAllEntities(java.lang.String aSchemaName)
          Deprecated. Removes all entities for the given journal schema.
 void removeEntity(java.lang.String anEntityName)
          Deprecated. Removes the entity anEntityName from the current journal schema.
 void removeEntity(java.lang.String anEntityName, java.lang.String aSchemaName)
          Deprecated. Removes the entity anEntityName from the journal schema aSchemaName.
 void removeSchema(java.lang.String aSchemaName)
          Deprecated. Removes a journal schema and all its related journal tables.
protected static java.lang.String tableName(java.lang.String aSchemaName, java.lang.String anEntityName, java.lang.String aGeneration)
          Deprecated. Returns the current journal table name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestedNumberOfGenerations

public int requestedNumberOfGenerations
Deprecated. 
Keeps the number of generations for the journal schema

requestedTableDefinition

public java.lang.String requestedTableDefinition
Deprecated. 
Keeps the journal tables definition in SQL format

schemaName

public java.lang.String schemaName
Deprecated. 
Keeps the journal schema name

databaseConnection

protected static java.sql.Connection databaseConnection
Deprecated. 
Keeps the connection to the database that will be used by the Db2JournalSchemaGenerator

createSchema

public static boolean createSchema
Deprecated. 
Constructor Detail

Db2JournalSchemaGenerator

public Db2JournalSchemaGenerator()
Deprecated. 
This constructor creates a Db2JournalSchemaGenerator object.

Db2JournalSchemaGenerator

public Db2JournalSchemaGenerator(java.lang.String aSchemaName)
                          throws DSEInvalidArgumentException,
                                 DSEInvalidRequestException,
                                 DSEInternalErrorException,
                                 DSESQLException
Deprecated. 
This constructor creates a Db2JournalSchemaGenerator object for the specified schema.
Parameters:
aSchemaName - java.lang.String the name of the Schema
Throws:
DSEInvalidArgumentException - if the Schema name is not valid
DSEInvalidRequestException - if the Schema already exists
DSEInternalErrorException - if an internal program error occurs
DSESQLException - when a SQL Exception is caught
Method Detail

addEntity

public void addEntity(java.lang.String anEntityName)
               throws DSESQLException,
                      DSEInvalidArgumentException,
                      DSEInternalErrorException,
                      DSEInvalidRequestException
Deprecated. 
Adds a new entity in the journal schema definition. If the entity already exists, it throws a DSEInvalidArgument exception.
Parameters:
anEntityName - java.lang.String the name of the entity to be added
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

allEntities

public Vector allEntities()
                   throws DSEInvalidRequestException,
                          DSEInternalErrorException,
                          DSESQLException
Deprecated. 
Returns a vector with the entities defined for the current journal schema.
Returns:
Vector the vector that contains all entities
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

allEntities

public static Vector allEntities(java.lang.String aSchemaName)
                          throws DSEInvalidRequestException,
                                 DSEInternalErrorException,
                                 DSESQLException
Deprecated. 
Returns a Vector with the entities names defined for the journal schema aSchemaName. It accesses the schema control table to get this information.
Parameters:
aSchemaName - java.lang.String, the name of the journal schema
Returns:
Vector - the vector that contains all entities
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

connect

public static void connect(java.lang.String aDatabaseURL)
                    throws DSEInternalErrorException,
                           DSEInvalidRequestException,
                           DSESQLException
Deprecated. 
Connects to the database with URL aDatabaseURL. The database support must prompt a logon panel to enter the user identification and password or a DSESQLException will be thrown if the JDBC Driver being used does not allow a connection without specifying the user information ( as in the case of the JDBC DB2 net driver).
Parameters:
aDatabaseURL - java.lang.String, the database URL
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

connect

public static void connect(java.lang.String aDatabaseURL,
                           java.lang.String aUser,
                           java.lang.String aPassword)
                    throws DSESQLException,
                           DSEInvalidRequestException,
                           DSEInternalErrorException
Deprecated. 
Connects to the database with the URL aDatabaseURL, user identification aUser, and password aPassword.
Parameters:
aDatabaseURL - java.lang.String, the database URL
aUser - java.lang.String, the user identification
aPassword - java.lang.String, the user password
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

controlTableName

protected static java.lang.String controlTableName(java.lang.String aSchemaName)
Deprecated. 
Returns the name of the control table for the schema name aSchemaName.
Parameters:
aSchemaName - java.lang.String, the name of the journal schema

currentJournalTableColumnData

public static DatabaseResultSetMetaData currentJournalTableColumnData(java.lang.String aSchemaName)
                                                               throws DSEInternalErrorException,
                                                                      DSEInvalidRequestException,
                                                                      DSEInvalidArgumentException,
                                                                      DSESQLException
Deprecated. 
Returns the DatabaseResultSetMetaData instance that contains the journal table columns information. This method always requests the information from the database. The table name must be constructed by concatenating the schema name (available by default or provided as an argument), an entity name, and a generation number. The entity name is obtained by calling the allEntities method.
Parameters:
aSchemaName - java.lang.String, the journal schema name
Returns:
DatabaseResultSetMetaData - the table meta data
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

currentJournalTableDefinition

public java.lang.String currentJournalTableDefinition(java.lang.String aSchemaName)
                                               throws DSEInvalidArgumentException,
                                                      DSEInvalidRequestException,
                                                      DSEInternalErrorException,
                                                      DSESQLException
Deprecated. 
Calls the currentJournalTableColumnsData method to get the DatabaseResultSetMetaData instance for the schema aSchemaName. From this information, it builds the string with the journal table columns definition.
Parameters:
aSchemaName - java.lang.String, the journal schema Name
Returns:
java.lang.String - the journal tables definition for the specified schema name in SQL format
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

disconnect

public static void disconnect()
                       throws DSESQLException
Deprecated. 
Closes the Database connection.
Throws:
DSESQLException - if a SQL Exception occurs

generateSchema

public void generateSchema(Vector aListOfEntities,
                           int nbrOfGenerations,
                           java.lang.String aTableDefinition)
                    throws DSEInvalidArgumentException,
                           DSEInvalidRequestException,
                           DSESQLException,
                           DSEInternalErrorException
Deprecated. 
Generates the journal schema with a default database schema name (set in the JournalConstants class in attribute DEFAULT_SCHEMA_NAME).
Parameters:
aListOfEntities - com.ibm.dse.base.Vector, the vector of journal entities
nbrOfGenerations - int, the number of journal generations
aTableDefinition - java.lang.String, the table definition in SQL format
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

generateSchema

public void generateSchema(Vector aListOfEntities,
                           int nbrOfGenerations,
                           java.lang.String aTableDefinition,
                           java.lang.String aSchemaName)
                    throws DSEInvalidArgumentException,
                           DSEInvalidRequestException,
                           DSESQLException,
                           DSEInternalErrorException
Deprecated. 
Generates the journal schema with name aSchemaName in the currently connected database.
Parameters:
aListOfEntities - com.ibm.dse.base.Vector, the vector of journal entities
nbrOfGenerations - int, the number of journal generations
aTableDefinition - java.lang.String, the table definition in SQL format
aSchemaName - java.lang.String, the journal schema name
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

generateSGML

public static Vector generateSGML(java.lang.String aSchemaName,
                                  java.lang.String aDatabaseURL,
                                  java.lang.String aUser,
                                  java.lang.String aPassword)
                           throws DSEInternalErrorException,
                                  DSEInvalidRequestException,
                                  DSESQLException,
                                  java.lang.Exception
Deprecated. 
Called by the SGML editor tool if the information to create the journal format definition is to be retrieved from the database. It uses the default JDBC driver set in the EJ_DEFAULT_DB2DRIVER attribute of class JournalConstants. It returns a Vector with the column names for the journal table (without the internally used DSERECN column).
Parameters:
aSchemaName - java.lang.String, the journal schema name
aDatabaseURL - java.lang.String, the URL of the database that keeps the journal tables
aUser - java.lang.String, the user identification to logon to the database
aPassword - java.lang.String, the user password to logon to the database
Returns:
com.ibm.dse.base.Vector
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
java.lang.Exception - if an exception has occurred

generateSGML

public static Vector generateSGML(java.lang.String aSchemaName,
                                  java.lang.String aDatabaseURL,
                                  java.lang.String aUser,
                                  java.lang.String aPassword,
                                  java.lang.String aJDBCDriverName)
                           throws java.lang.Exception,
                                  DSEInternalErrorException,
                                  DSEInvalidRequestException,
                                  DSESQLException
Deprecated. 
Called by the SGML editor tool if the information to create the journal format definition is to be retrieved from the database. It loads and registers the JDBC driver, which is passed as an argument. It returns a Vector with the column names for the journal table (without the internally used DSERECN column).
Parameters:
aSchemaName - java.lang.String, the journal schema name
aDatabaseURL - java.lang.String, the URL of the database that keeps the journal tables
aUser - java.lang.String, the user identification to logon to the database
aPassword - java.lang.String, the user password to logon to the database
aJDBCDriverName - java.lang.String, the name of the JDBC driver that will be used to access the database
Returns:
com.ibm.dse.base.Vector
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
java.lang.Exception - if an exception has occurred

getMetaData

protected static DatabaseResultSetMetaData getMetaData(java.lang.String aSchemaName)
                                                throws DSEInvalidArgumentException,
                                                       DSEInvalidRequestException,
                                                       DSEInternalErrorException,
                                                       DSESQLException
Deprecated. 
Returns the DatabaseResultSetMetaData instance associated with the schema aSchemaName.
Parameters:
aSchemaName - java.lang.String, the journal schema name
Returns:
DatabaseResultSetMetaData the DatabaseResultSetMetaData (null if the key is not mapped to any value)
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

journalTableDefinition

public java.lang.String journalTableDefinition()
                                        throws DSEException
Deprecated. 
Returns a string with the SQL definition of the journal tables columns.
Returns:
java.lang.String
Throws:
DSEException - if a DSEException occurs

numberOfGenerations

public int numberOfGenerations()
                        throws DSEInvalidRequestException,
                               DSESQLException,
                               DSEInternalErrorException
Deprecated. 
Returns the number of journal generations in the journal service definition.
Returns:
int
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

numberOfGenerations

public static int numberOfGenerations(java.lang.String aSchemaName)
                               throws DSEInvalidRequestException,
                                      DSESQLException,
                                      DSEInternalErrorException
Deprecated. 
Returns the number of journal generations for the schema aSchemaName.
Parameters:
aSchemaName - java.lang.String, the journal schema name
Returns:
int
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

removeAllEntities

public void removeAllEntities(java.lang.String aSchemaName)
                       throws DSEInvalidArgumentException,
                              DSEInvalidRequestException,
                              DSEInternalErrorException,
                              DSESQLException
Deprecated. 
Removes all entities for the given journal schema.
Parameters:
aSchemaName - java.lang.String, the name of the journal schema
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

removeEntity

public void removeEntity(java.lang.String anEntityName)
                  throws DSEInternalErrorException,
                         DSEInvalidArgumentException,
                         DSEInvalidRequestException,
                         DSESQLException
Deprecated. 
Removes the entity anEntityName from the current journal schema.
Parameters:
anEntityName - java.lang.String, the entity name
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

removeEntity

public void removeEntity(java.lang.String anEntityName,
                         java.lang.String aSchemaName)
                  throws DSEInvalidArgumentException,
                         DSEInvalidRequestException,
                         DSEInternalErrorException,
                         DSESQLException
Deprecated. 
Removes the entity anEntityName from the journal schema aSchemaName.
Parameters:
anEntityName - java.lang.String, the entity name
aSchemaName - java.lang.String, the journal schema name
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

removeSchema

public void removeSchema(java.lang.String aSchemaName)
                  throws DSEInvalidRequestException,
                         DSEInvalidArgumentException,
                         DSEInternalErrorException,
                         DSESQLException
Deprecated. 
Removes a journal schema and all its related journal tables.
Parameters:
aSchemaName - java.lang.String, the name of the journal schema
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

tableName

protected static java.lang.String tableName(java.lang.String aSchemaName,
                                            java.lang.String anEntityName,
                                            java.lang.String aGeneration)
Deprecated. 
Returns the current journal table name.
Parameters:
aSchemaName - java.lang.String, the journal schema name
anEntityName - java.lang.String, the entity name
aGeneration - java.lang.String, the journal generation
Returns:
java.lang.String - the full table name