IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.services.jdbc
Class JDBCStoreSchemaGenerator

java.lang.Object
  extended by com.ibm.btt.services.jdbc.JDBCServicesAdministrator
      extended by com.ibm.btt.services.jdbc.JDBCStoreSchemaGenerator

public class JDBCStoreSchemaGenerator
extends JDBCServicesAdministrator


Field Summary
static java.lang.String catalogName
          Keeps the store catalog name.
 boolean createIndex
          Keeps the createIndex attribute value.
static boolean createSchema
          Keeps the createSchema attribute value.
 java.lang.String databaseName
          Keeps the databaseName attribute value.
 java.lang.String indexName
          Keeps the indexName attribute value.
static java.lang.String schemaName
          Keeps the store schema name.
 
Fields inherited from class com.ibm.btt.services.jdbc.JDBCServicesAdministrator
COMPID, databaseConnection, getSchemaSem
 
Constructor Summary
JDBCStoreSchemaGenerator()
          This constructor creates a JDBCStoreSchemaGenerator object.
 
Method Summary
 void connect(java.lang.String aDatabaseURL)
          Connects to the database with aDatabaseURL.
 void connect(java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword)
          Connects to the database using the aDatabaseURL, aUser, and aPassword.
 void generateTable(java.lang.String aTableName, java.lang.String aTableDefinition)
          Generates the Store table in the selected database with aTableName name.
 void generateTable(java.lang.String aSchemaName, java.lang.String aTableName, java.lang.String aTableDefinition)
          Generates the store table in the selected database with aTableName name.
 java.lang.String getCatalogName()
          Returns the catalogName attribute value.
 java.lang.String getDatabaseName()
          Returns the databaseName attribute.
 java.lang.String getIndexName()
          Returns the indexName attribute.
protected static DatabaseResultSetMetaData getMetaData(java.lang.String aTableName)
          Returns the DatabaseResultSetMetaData associated with a Store Table.
 java.lang.String getSchemaName()
          Returns the schemaName attribute value.
 boolean isCreateIndex()
          Returns true if the application has requested to create an index on the store table.
 boolean isCreateSchema()
          Returns the createSchema attribute value.
 void loadDriver()
          Loads the JDBC Driver as set in the JournalConstants ST_DEFAULT_JDBCDRIVER attribute.
 void loadDriver(java.lang.String aDriverName)
          Loads the JDBC Driver explicitly provided as an argument.
 void setCatalogName(java.lang.String s)
          Sets the catalogName attribute to the string provided as argument.
 void setCreateIndex(boolean newCreateIndex)
          Sets the createIndex attribute value to newCreateIndex.
 void setCreateSchema(boolean newCreateSchema)
          Sets the createSchema attribute value to newCreateSchema.
 void setDatabaseName(java.lang.String newDatabaseName)
          Sets the databaseName attribute value to newDatabaseName.
 void setIndexName(java.lang.String newIndexName)
          Sets the indexName attribute value to newIndexName.
 void setSchemaName(java.lang.String s)
          Sets the schemaName attribute to the string provided as an argument.
 
Methods inherited from class com.ibm.btt.services.jdbc.JDBCServicesAdministrator
disconnect, dropProcedure, getConnectionManager, getProcedureMetaData, isRegistered, isRegistered, registerProcedure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schemaName

public static java.lang.String schemaName
Keeps the store schema name.


catalogName

public static java.lang.String catalogName
Keeps the store catalog name.


databaseName

public java.lang.String databaseName
Keeps the databaseName attribute value. This attribute is used when working with DB2 UDB in OS/390. In this environment, the database URL as set in the database connection has the following format: jdbc:db2os390:", where is the name of a shared database subsystem with different databases and storage groups defined in it. If not specified, the store table will be created in the default database within this location.


createSchema

public static boolean createSchema
Keeps the createSchema attribute value. This attribute is set to true if the database schema representing the journal schema is to be created in the database, executing a CREATE SCHEMA statement. If this attribute is set to false, the database schema will not be created.


indexName

public java.lang.String indexName
Keeps the indexName attribute value. This attribute is used when working with DB2 UDB in OS/390. In this environment, when a table is created, also an index on that table must be created ( while in other operating systems a default index is automatically created). This attribute contains the index name to be used in the CREATE INDEX statement. Default value is the store contant ST_RECID_COLUMN_NAME value.


createIndex

public boolean createIndex
Keeps the createIndex attribute value. This attribute is set to true if after the creation of the store table unique index on the primary key must be explicitly created, executing a CREATE UNIQUE INDEX statement. If this attribute is set to false, the index will not be created.

Constructor Detail

JDBCStoreSchemaGenerator

public JDBCStoreSchemaGenerator()
This constructor creates a JDBCStoreSchemaGenerator object.

Method Detail

connect

public void connect(java.lang.String aDatabaseURL)
             throws DSEInternalErrorException,
                    DSEInvalidRequestException,
                    DSESQLException
Connects to the database with 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 does not allow a connection without specifying the user information (as is the case for the JDBC DB2 net driver).

Overrides:
connect in class JDBCServicesAdministrator
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 SQLException is caught

connect

public void connect(java.lang.String aDatabaseURL,
                    java.lang.String aUser,
                    java.lang.String aPassword)
             throws DSESQLException,
                    DSEInvalidRequestException,
                    DSEInternalErrorException
Connects to the database using the aDatabaseURL, aUser, and aPassword.

Overrides:
connect in class JDBCServicesAdministrator
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 SQLException is caught

generateTable

public void generateTable(java.lang.String aTableName,
                          java.lang.String aTableDefinition)
                   throws DSEInvalidArgumentException,
                          DSESQLException,
                          DSEInternalErrorException,
                          DSEInvalidRequestException
Generates the Store table in the selected database with aTableName name. The aTableDefinition contains the definition of the columns within the table in SQL format.

Parameters:
aTableName - java.lang.String
aTableDefinition - java.lang.String
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException

generateTable

public void generateTable(java.lang.String aSchemaName,
                          java.lang.String aTableName,
                          java.lang.String aTableDefinition)
                   throws DSEInvalidArgumentException,
                          DSESQLException,
                          DSEInternalErrorException,
                          DSEInvalidRequestException
Generates the store table in the selected database with aTableName name. The aTableDefinition contains the definition of the columns within the table in SQL format.

Parameters:
aSchemaName - java.lang.String
aTableName - java.lang.String
aTableDefinition - java.lang.String
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException

getCatalogName

public java.lang.String getCatalogName()
Returns the catalogName attribute value.

Returns:
java.lang.String

getDatabaseName

public java.lang.String getDatabaseName()
Returns the databaseName attribute. Used in OS/390 environment to identify the database inside the location referenced by the database URL where the table is to be created.

Returns:
java.lang.String

getIndexName

public java.lang.String getIndexName()
Returns the indexName attribute. This is used in OS/390 environment to create an index on the store table DSERECID column named indexName.

Returns:
java.lang.String

getMetaData

protected static DatabaseResultSetMetaData getMetaData(java.lang.String aTableName)
                                                throws DSEInvalidArgumentException,
                                                       DSEInternalErrorException,
                                                       DSESQLException
Returns the DatabaseResultSetMetaData associated with a Store Table. This method firs checks whether this information already exists in the tablesMetaData Hashtable and, if it is not found, gets the information from the Database and adds it to the tablesMetaData Hashtable.

Parameters:
aTableName - java.lang.String - the store table name
Returns:
DatabaseResultSetMetaData
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught

getSchemaName

public java.lang.String getSchemaName()
Returns the schemaName attribute value.

Returns:
java.lang.String

isCreateIndex

public boolean isCreateIndex()
Returns true if the application has requested to create an index on the store table. If false is returned, the index will not be explicitly created.


isCreateSchema

public boolean isCreateSchema()
Returns the createSchema attribute value.

Returns:
boolean

loadDriver

public void loadDriver()
                throws DSEInternalErrorException
Loads the JDBC Driver as set in the JournalConstants ST_DEFAULT_JDBCDRIVER attribute.

Throws:
DSEInternalErrorException - if an internal program error occurs

loadDriver

public void loadDriver(java.lang.String aDriverName)
                throws DSEInternalErrorException
Loads the JDBC Driver explicitly provided as an argument.

Parameters:
aDriverName - java.lang.String - the driver name (full path)
Throws:
DSEInternalErrorException - if an internal program error occurs

setCatalogName

public void setCatalogName(java.lang.String s)
Sets the catalogName attribute to the string provided as argument.

Parameters:
s - java.lang.String

setCreateIndex

public void setCreateIndex(boolean newCreateIndex)
Sets the createIndex attribute value to newCreateIndex.

Parameters:
newCreateIndex - boolean

setCreateSchema

public void setCreateSchema(boolean newCreateSchema)
Sets the createSchema attribute value to newCreateSchema.

Parameters:
newCreateSchema - boolean

setDatabaseName

public void setDatabaseName(java.lang.String newDatabaseName)
Sets the databaseName attribute value to newDatabaseName.

Parameters:
newDatabaseName - java.lang.String

setIndexName

public void setIndexName(java.lang.String newIndexName)
Sets the indexName attribute value to newIndexName.

Parameters:
newIndex - java.lang.String

setSchemaName

public void setSchemaName(java.lang.String s)
Sets the schemaName attribute to the string provided as an argument.

Parameters:
s - java.lang.String

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011