IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.services.jdbcjournalservice
Class JDBCJournal

java.lang.Object
  extended bycom.ibm.btt.base.Service
      extended bycom.ibm.btt.services.BTTServiceRequester
          extended bycom.ibm.btt.services.PooledServiceRequester
              extended bycom.ibm.btt.services.jdbcservicesinfra.JDBCService
                  extended bycom.ibm.btt.services.jdbcjournalservice.Journal
                      extended bycom.ibm.btt.services.jdbcjournalservice.JDBCJournal
All Implemented Interfaces:
DatabaseConnect, Externalizable, java.io.Externalizable, JournalService, java.io.Serializable

public class JDBCJournal
extends Journal
implements JournalService

The JDBCJournal class is a concrete class that represents a Financial Electronic Journal to provide an implementation of the Journal abstraction. The JDBCJournal uses the JDBC interface to access the database and can be used with any DBMS providing an implementation of this interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.btt.services.jdbcjournalservice.Journal
COMPID
 
Fields inherited from class com.ibm.btt.services.jdbcservicesinfra.JDBCService
addPstmt, addString, autoCommit, connectionProperties, databaseConnection, databaseURL, dataSourceName, metaData, password, poolName, sharedConnection, STMT_POOL_SIZE_DEFAULT, stmtPool, stmtPoolSize, updateString, user, waitRetry
 
Fields inherited from class com.ibm.btt.services.PooledServiceRequester
poolable, poolId
 
Fields inherited from class com.ibm.btt.base.Service
externalizer, name
 
Constructor Summary
JDBCJournal()
           
 
Method Summary
 int addRecord(Context aContext, FormatElement aHashtableFormat)
          Calls the formatter format method by passing aContext as an argument.
 int addRecord(Context aContext, java.lang.String aFormatName)
          Instantiates the journal format with the name aFormatName and calls its format method by passing aContext as an argument.
 int addRecord(Hashtable aDataHashtable)
          Inserts the data in aDataHashtable as a new row in the current journal table.
 void close()
          Closes the journal (sets its status to inactive).
 void commit()
          Commits all changes to the database.
 void connect(java.lang.String anUser, java.lang.String aPwd)
          Disconnect database.
 void disconnect()
          Disconnect database.
 int getLastRecordNumberFromTable()
          Returns the lastRecordNumber from control table.
 void open(java.lang.String anEntity, int aGeneration)
          Opens the journal service with an entity and a generation number
 void open(java.lang.String aSchemaName, java.lang.String anEntity, int aGeneration)
          Opens the journal service with a specific shema, an entity, and a generation number.
 void openForEntity(java.lang.String anEntity)
          Opens the current journal table for anEntity.
 void openForEntity(java.lang.String anEntity, java.lang.String aSchemaName)
          Decides which is going to be the current journal table for anEntity.
 void openForSchema(java.lang.String aSchemaName)
          Decides which is going to be the current journal table.
 void openOnCurrentTable()
          Selects the already selected table generation for the current schema as the current journal table.
 void openOnNextTable()
          Selects the next available table generation for the current schema as the current journal table.
 int queryLastRecordNumber()
          Returns the last record number in the current journal table.
 Hashtable retrieveLastRecord()
          Retrieves the last record of the current journal table.
 void retrieveLastRecord(Context aContext, FormatElement aHashtableFormat)
          Retrieves the last record of the current journal table by calling the retrieveRecord(int, Context, FormatElement) method with the last record number as the first parameter.
 void retrieveLastRecord(Context aContext, java.lang.String aFormatName)
          Retrieves the last record of the current journal table by calling the retrieveRecord(int, Context, String) method with the last record number as first parameter.
 Vector retrieveLastRecords(int aRecordCount)
          Returns a vector with aNumber or any number between 0 and aNumber of record Hashtables.
 void retrieveLastRecords(int aRecordCount, Context aContext, FormatElement anOutputFormat)
          Retrieves the last aNumber records from the journal table and unformats them into the aContext using the anOutputFormat formatter.
 void retrieveLastRecords(int aRecordCount, Context aContext, java.lang.String anOutputFormatName)
          Retrieves the last aNumber records from the journal table and unformats them into the aContext using the named anOutputFormatName formatter.
 Hashtable retrieveRecord(int aRecordNumber)
          Retrieves the record with the record identification in the database equal to aRecordNumber.
 void retrieveRecord(int aRecordNumber, Context aContext, FormatElement aHashtableFormat)
          Retrieves the record with record identification in the database equal to aRecordNumber.
 void retrieveRecord(int aRecordNumber, Context aContext, java.lang.String aFormatName)
          Retrieves the record with record identification in the database equal to aRecordNumber.
 Vector retrieveRecords(java.lang.String aSearchCondition)
          Retrieves all the records within the current journal that match aSearchCondition.
 void retrieveRecords(java.lang.String aSearchCondition, Context aContext, FormatElement anOutputFormat)
          Retrieves all the records within the current journal that match aSearchCondition.
 void retrieveRecords(java.lang.String aSearchCondition, Context aContext, java.lang.String anOutputFormatName)
          Retrieves all the records within the current journal that match aSearchCondition.
 Vector retrieveRecords(java.lang.String aSearchCondition, Vector aColumnsVector)
          Retrieves the columns in aColumnsVector of all the records within the current journal that match aSearchCondition.
 void retrieveRecords(java.lang.String aSearchCondition, Vector aColumnsVector, Context aContext, FormatElement anOutputFormat)
          Retrieves the columns in aColumnsVector of all the records within the current journal that match aSearchCondition.
 void retrieveRecords(java.lang.String aSearchCondition, Vector aColumnsVector, Context aContext, java.lang.String anOutputFormatName)
          Retrieves the columns in aColumnsVector of all the records within the current journal that match aSearchCondition.
 void rollback()
          Rolls back all database changes.
 void setEntity(java.lang.String anEntityName)
          Sets the entity property value to anEntityName.
 int updateLastRecord(Context aContext, FormatElement aHashtableFormat)
          Updates the last record of the current journal table by calling the updateRecords(String, Context, FormatElement) method.
 int updateLastRecord(Context aContext, FormatElement aHashtableFormat, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector for the last record of the current journal table by calling the updateRecords(String, Context, FormatElement, Vector) method.
 int updateLastRecord(Context aContext, java.lang.String aFormatName)
          Updates the last record of the current journal table by calling the updateRecords(String, Context, String) method.
 int updateLastRecord(Context aContext, java.lang.String aFormatName, Vector aColumnsVector)
          Updates the columns in aColumnsVector for the last record of the current journal table by calling the updateRecords(String, Context, String, Vector) method.
 int updateLastRecord(Hashtable aDataHashtable)
          Updates the last record of the current journal table with the data in aDataHashtable.
 int updateLastRecord(Hashtable aDataHashtable, Vector aColumnsVector)
          Updates the columns in aColumnsVector for the last record of the current journal table with the data in aDataHashtable.
 int updateRecord(int aRecordNumber, Context aContext, FormatElement aHashtableFormat)
          Updates the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, FormatElement) method.
 int updateRecord(int aRecordNumber, Context aContext, FormatElement aHashtableFormat, Vector aColumnsVector)
          Updates the columns in aColumnsVector for the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, FormatElement, Vector) method.
 int updateRecord(int aRecordNumber, Context aContext, java.lang.String aFormatName)
          Updates the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, String) method.
 int updateRecord(int aRecordNumber, Context aContext, java.lang.String aFormatName, Vector aColumnsVector)
          Updates the columns in aColumnsVector for the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, String, Vector) method.
 int updateRecord(int aRecordNumber, Hashtable aDataHashtable)
          Updates the record identified by aRecordNumber within the journal table with the data provided in aDataHashtable by calling the updateRecords(String, Hashtable) method.
 int updateRecord(int aRecordNumber, Hashtable aDataHashtable, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector, for the record identified by aRecordNumber within the journal table, with the data provided in aDataHashtable.
 int updateRecords(java.lang.String aSearchCondition, Context aContext, FormatElement aHashtableFormat)
          Updates all the current journal table records that match the search condition passed as an argument, with the data obtained by formatting aContext with the journal aHashtableFormat formatter.
 int updateRecords(java.lang.String aSearchCondition, Context aContext, FormatElement aHashtableFormat, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector for all the current journal table records that match the search condition passed as an argument, with the data obtained by formatting aContext with the journal formatter aHashtableFormat.
 int updateRecords(java.lang.String aSearchCondition, Context aContext, java.lang.String aFormatName)
          Updates all the current journal table records that match the search condition passed as an argument, with the data obtained by formatting aContext with the formatter defined by aFormatName.
 int updateRecords(java.lang.String aSearchCondition, Context aContext, java.lang.String aFormatName, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector for all the current journal table records that match the search condition passed as an argument, with the data obtained by formatting aContext with the formatter defined by aFormatName.
 int updateRecords(java.lang.String aSearchCondition, Hashtable aDataHashtable)
          Updates all the current journal table records that match the search condition with the aDataHashtable data.
 int updateRecords(java.lang.String aSearchCondition, Hashtable aDataHashtable, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector with the data provided in aDataHashtable for the records matching the search condition within the journal table.
 
Methods inherited from class com.ibm.btt.services.jdbcjournalservice.Journal
initialize, open, reset, terminate
 
Methods inherited from class com.ibm.btt.services.jdbcservicesinfra.JDBCService
connect, getAutoCommit, getDataSourceName, getPassword, getUser, isConnected, isWaitRetry, setAutoCommit, setDataSourceName, setPassword, setUser, setWaitRetry, verifyConnection
 
Methods inherited from class com.ibm.btt.services.PooledServiceRequester
getGrantTime, getPoolable, getPoolable, getPoolId, getServiceID, grantServiceID, initializeFrom, initializeFrom, processRequest, releaseOrphan, releaseOrphan, releasePoolable, releaseServiceRequester, setGrantTime, setPoolId
 
Methods inherited from class com.ibm.btt.services.BTTServiceRequester
getCachingEnabled, getInactiveTimeout, getLastAccess, getServiceInvocation, getServiceType, HashMapToHashtable, newInstance, setCachingEnabled, setInactiveTimeout, setLastAccess, setServiceID, setServiceInvocation, setServiceType
 
Methods inherited from class com.ibm.btt.base.Service
externalizer, getExternalizer, getName, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, setName, toString, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.btt.services.jdbcjournalservice.JournalService
open
 
Methods inherited from interface com.ibm.btt.services.jdbcservicesinfra.DatabaseConnect
getDataSourceName, isConnected, isWaitRetry, setDataSourceName, setWaitRetry
 

Constructor Detail

JDBCJournal

public JDBCJournal()
Method Detail

addRecord

public int addRecord(Context aContext,
                     FormatElement aHashtableFormat)
              throws DSEInvalidArgumentException,
                     DSEInvalidRequestException,
                     DSEInternalErrorException,
                     DSESQLException
Calls the formatter format method by passing aContext as an argument. The returned object, a Hashtable instance, is then used to build and insert the journal record by calling the addRecord method with an argument of a data hashtable.

Specified by:
addRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.client.FormatElement
Returns:
int - the row number where the journal record is inserted
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 SQLException is caught

addRecord

public int addRecord(Context aContext,
                     java.lang.String aFormatName)
              throws DSEInvalidArgumentException,
                     DSEInvalidRequestException,
                     DSEInternalErrorException,
                     DSESQLException
Instantiates the journal format with the name aFormatName and calls its format method by passing aContext as an argument. The returned object, a Hashtable instance, is then used to build and insert the journal record by calling the addRecord method with an argument of a data hashtable.

Specified by:
addRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context, the context where the data is
aFormatName - java.lang.String, the format name of the formatter to be used
Returns:
int - the row number where the journal record is inserted
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 SQLException is caught

addRecord

public int addRecord(Hashtable aDataHashtable)
              throws DSEInvalidRequestException,
                     DSEInvalidArgumentException,
                     DSEInternalErrorException,
                     DSESQLException
Inserts the data in aDataHashtable as a new row in the current journal table. The data hashtable has the format: key=data_field_name, value=data_field_value

Specified by:
addRecord in interface JournalService
Specified by:
addRecord in class Journal
Parameters:
aDataHashtable - Hashtable - the Hashtable with the data to be inserted in the database table
Returns:
int - the row number where the data is inserted
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 SQLException is caught

commit

public void commit()
            throws DSESQLException,
                   DSEInternalErrorException
Commits all changes to the database. If the autoCommit attribute is set to true, it does nothing.

Specified by:
commit in interface JournalService
Specified by:
commit in class Journal
Throws:
DSESQLException - if commit failed
DSEInternalErrorException - if communication with journal service object failed

openOnCurrentTable

public void openOnCurrentTable()
                        throws DSEInvalidRequestException,
                               DSEInternalErrorException,
                               DSEInvalidArgumentException,
                               DSESQLException
Selects the already selected table generation for the current schema as the current journal table. It sets the journal attributes to a value that is adequate to start working with this table.

Specified by:
openOnCurrentTable in class Journal
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 SQLException is caught

openOnNextTable

public void openOnNextTable()
                     throws DSEInternalErrorException,
                            DSEInvalidRequestException,
                            DSEInvalidArgumentException,
                            DSESQLException
Selects the next available table generation for the current schema as the current journal table. It sets the journal attributes to a value that is adequate to start working with this table.

Specified by:
openOnNextTable in class Journal
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 SQLException is caught

queryLastRecordNumber

public int queryLastRecordNumber()
                          throws DSESQLException,
                                 DSEInternalErrorException
Returns the last record number in the current journal table. The database is accessed to get this information.

Specified by:
queryLastRecordNumber in interface JournalService
Specified by:
queryLastRecordNumber in class Journal
Returns:
int
Throws:
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

retrieveLastRecord

public Hashtable retrieveLastRecord()
                             throws DSEInternalErrorException,
                                    DSEInvalidArgumentException,
                                    DSESQLException
Retrieves the last record of the current journal table.

Specified by:
retrieveLastRecord in interface JournalService
Specified by:
retrieveLastRecord in class Journal
Returns:
Hashtable - a Hashtable built from the retrieved record column values
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

retrieveLastRecord

public void retrieveLastRecord(Context aContext,
                               FormatElement aHashtableFormat)
                        throws DSEInvalidRequestException,
                               DSEInternalErrorException,
                               DSEInvalidArgumentException,
                               DSESQLException
Retrieves the last record of the current journal table by calling the retrieveRecord(int, Context, FormatElement) method with the last record number as the first parameter.

Specified by:
retrieveLastRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.client.FormatElement
Throws:
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if an argument is not valid
DSESQLException - if an SQLException is caught

retrieveLastRecord

public void retrieveLastRecord(Context aContext,
                               java.lang.String aFormatName)
                        throws DSEInvalidRequestException,
                               DSEInternalErrorException,
                               DSEInvalidArgumentException,
                               DSESQLException
Retrieves the last record of the current journal table by calling the retrieveRecord(int, Context, String) method with the last record number as first parameter.

Specified by:
retrieveLastRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String
Throws:
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if an argument is not valid
DSESQLException - if an SQLException is caught

retrieveLastRecords

public Vector retrieveLastRecords(int aRecordCount)
                           throws DSEInternalErrorException,
                                  DSEInvalidRequestException,
                                  DSEInvalidArgumentException,
                                  DSESQLException
Returns a vector with aNumber or any number between 0 and aNumber of record Hashtables.

Specified by:
retrieveLastRecords in interface JournalService
Specified by:
retrieveLastRecords in class Journal
Parameters:
aRecordCount - int, the number of records to retrieve
Returns:
com.ibm.dse.base.Vector
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

retrieveLastRecords

public void retrieveLastRecords(int aRecordCount,
                                Context aContext,
                                FormatElement anOutputFormat)
                         throws DSEInternalErrorException,
                                DSEInvalidArgumentException,
                                DSEInvalidRequestException,
                                DSESQLException,
                                DSEObjectNotFoundException
Retrieves the last aNumber records from the journal table and unformats them into the aContext using the anOutputFormat formatter.

Parameters:
aRecordCount - int the number of records to retrieve
aContext - com.ibm.dse.base.Context - the context to where the retrieved records will be unformatted
anOutputFormat - com.ibm.btt.formatter.client.FormatElement - the formatter to unformat the retrieved records
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSESObjectNotFoundException - if an object is not found
DSEObjectNotFoundException

retrieveLastRecords

public void retrieveLastRecords(int aRecordCount,
                                Context aContext,
                                java.lang.String anOutputFormatName)
                         throws DSEInternalErrorException,
                                DSEInvalidArgumentException,
                                DSEInvalidRequestException,
                                DSESQLException,
                                DSEObjectNotFoundException
Retrieves the last aNumber records from the journal table and unformats them into the aContext using the named anOutputFormatName formatter.

Parameters:
aRecordCount - int the number of records to retrieve
aContext - com.ibm.dse.base.Context - the context to where the retrieved records will be unformatted
anOutputFormatName - java.lang.String - the name of the formatter to unformat the retrieved records
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSESObjectNotFoundException - if an object is not found
DSEObjectNotFoundException

retrieveRecord

public Hashtable retrieveRecord(int aRecordNumber)
                         throws DSEInternalErrorException,
                                DSEInvalidArgumentException,
                                DSESQLException
Retrieves the record with the record identification in the database equal to aRecordNumber.

Specified by:
retrieveRecord in interface JournalService
Specified by:
retrieveRecord in class Journal
Parameters:
aRecordNumber - int the record number
Returns:
Hashtable - a Hashtable built from the retrieved record column values
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

retrieveRecord

public void retrieveRecord(int aRecordNumber,
                           Context aContext,
                           FormatElement aHashtableFormat)
                    throws DSEInvalidRequestException,
                           DSEInternalErrorException,
                           DSEInvalidArgumentException,
                           DSESQLException
Retrieves the record with record identification in the database equal to aRecordNumber. The retrieved record is converted into a Hashtable by calling the retrieveRecord(int aRecordNumber) method and aContext is updated with the result of unformatting that Hashtable with the aHashtableFormat formatter.

Specified by:
retrieveRecord in class Journal
Parameters:
aRecordNumber - int
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.client.FormatElement
Throws:
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if an argument is not valid
DSESQLException - if an SQLException is caught

retrieveRecord

public void retrieveRecord(int aRecordNumber,
                           Context aContext,
                           java.lang.String aFormatName)
                    throws DSEInvalidRequestException,
                           DSEInternalErrorException,
                           DSEInvalidArgumentException,
                           DSESQLException
Retrieves the record with record identification in the database equal to aRecordNumber. The retrieved record is converted into a Hashtable by calling the retrieveRecord(int aRecordNumber) method and aContext is updated with the result of unformatting that Hashtable with the formatter defined by aFormatName.

Specified by:
retrieveRecord in class Journal
Parameters:
aRecordNumber - int
aContext - com.ibm.dse.base.Context
aFormatName - java.lang.String
Throws:
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if an argument is not valid
DSESQLException - if an SQLException is caught

retrieveRecords

public Vector retrieveRecords(java.lang.String aSearchCondition)
                       throws DSEInternalErrorException,
                              DSEInvalidRequestException,
                              DSEInvalidArgumentException,
                              DSESQLException
Retrieves all the records within the current journal that match aSearchCondition.

Specified by:
retrieveRecords in interface JournalService
Specified by:
retrieveRecords in class Journal
Parameters:
aSearchCondition - java.lang.String the search condition in SQL format
Returns:
com.ibm.dse.base.Vector
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

retrieveRecords

public void retrieveRecords(java.lang.String aSearchCondition,
                            Context aContext,
                            FormatElement anOutputFormat)
                     throws DSEInternalErrorException,
                            DSEInvalidRequestException,
                            DSEInvalidArgumentException,
                            DSESQLException,
                            DSEObjectNotFoundException
Retrieves all the records within the current journal that match aSearchCondition. The retrieved records are then unformatted into the context aContext using anOutputFormat.

Parameters:
aSearchCondition - java.lang.String the search condition in SQL format
aContext - com.ibm.dse.base.Context the context to where the retrieved records will be unformatted
anOutputFormat - com.ibm.btt.formatter.FormatElement - the formatter to unformat the retrieved records
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSESObjectNotFoundException - if an object is not found
DSEObjectNotFoundException

retrieveRecords

public void retrieveRecords(java.lang.String aSearchCondition,
                            Context aContext,
                            java.lang.String anOutputFormatName)
                     throws DSEInternalErrorException,
                            DSEInvalidRequestException,
                            DSEInvalidArgumentException,
                            DSESQLException,
                            DSEObjectNotFoundException
Retrieves all the records within the current journal that match aSearchCondition. The retrieved records are then unformatted into the context aContext using the format named anOutputFormatName.

Parameters:
aSearchCondition - java.lang.String the search condition in SQL format
aContext - com.ibm.dse.base.Context the context to where the retrieved records will be unformatted
anOutputFormatName - java.lang.String - the name of the formatter to unformat the retrieved records
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSESObjectNotFoundException - if an object is not found
DSEObjectNotFoundException

retrieveRecords

public Vector retrieveRecords(java.lang.String aSearchCondition,
                              Vector aColumnsVector)
                       throws DSEInternalErrorException,
                              DSEInvalidRequestException,
                              DSEInvalidArgumentException,
                              DSESQLException
Retrieves the columns in aColumnsVector of all the records within the current journal that match aSearchCondition.

Specified by:
retrieveRecords in interface JournalService
Parameters:
aSearchCondition - java.lang.String the search condition in SQL format
aColumnsVector - com.ibm.dse.base.Vector the vector that contains the columns to be retrieved
Returns:
com.ibm.dse.base.Vector the vector of hash tables with the retrieved records
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

retrieveRecords

public void retrieveRecords(java.lang.String aSearchCondition,
                            Vector aColumnsVector,
                            Context aContext,
                            FormatElement anOutputFormat)
                     throws DSEInternalErrorException,
                            DSEInvalidRequestException,
                            DSEInvalidArgumentException,
                            DSESQLException,
                            DSEObjectNotFoundException
Retrieves the columns in aColumnsVector of all the records within the current journal that match aSearchCondition. The retrieved records are then unformatted into the context aContext using anOutputFormat.

Parameters:
aSearchCondition - java.lang.String the search condition in SQL format
aColumnsVector - com.ibm.dse.base.Vector the vector that contains the columns to be retrieved
aContext - com.ibm.dse.base.Context the context to where the retrieved records will be unformatted
anOutputFormat - com.ibm.btt.formatter.client.FormatElement the formatter to unformat the retrieved records
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEObjectNotFoundException - if an object is not found

retrieveRecords

public void retrieveRecords(java.lang.String aSearchCondition,
                            Vector aColumnsVector,
                            Context aContext,
                            java.lang.String anOutputFormatName)
                     throws DSEInternalErrorException,
                            DSEInvalidRequestException,
                            DSEInvalidArgumentException,
                            DSESQLException,
                            DSEObjectNotFoundException
Retrieves the columns in aColumnsVector of all the records within the current journal that match aSearchCondition. The retrieved records are then unformatted into the context aContext using the format named anOutputFormatName.

Parameters:
aSearchCondition - java.lang.String the search condition in SQL format
aColumnsVector - com.ibm.dse.base.Vector the vector that contains the columns to be retrieved
aContext - com.ibm.dse.base.Context the context to where the retrieved records will be unformatted
anOutputFormatName - java.lang.String the name of the formatter to unformat the retrieved records
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEObjectNotFoundException - if an object is not found

rollback

public void rollback()
              throws DSESQLException,
                     DSEInternalErrorException
Rolls back all database changes.

Specified by:
rollback in interface JournalService
Specified by:
rollback in class Journal
Throws:
DSESQLException - Thrown when the rollback fails
DSEInternalErrorException

updateLastRecord

public int updateLastRecord(Context aContext,
                            FormatElement aHashtableFormat)
                     throws DSEInvalidRequestException,
                            DSEInternalErrorException,
                            DSEInvalidArgumentException,
                            DSESQLException
Updates the last record of the current journal table by calling the updateRecords(String, Context, FormatElement) method.

Specified by:
updateLastRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.client.FormatElement
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateLastRecord

public int updateLastRecord(Context aContext,
                            FormatElement aHashtableFormat,
                            Vector aColumnsVector)
                     throws DSEInvalidRequestException,
                            DSEInternalErrorException,
                            DSEInvalidArgumentException,
                            DSESQLException
Updates the columns specified in aColumnsVector for the last record of the current journal table by calling the updateRecords(String, Context, FormatElement, Vector) method.

Parameters:
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.FormatElement
aColumnsVector - com.ibm.dse.base.Vector, the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateLastRecord

public int updateLastRecord(Context aContext,
                            java.lang.String aFormatName)
                     throws DSEInvalidRequestException,
                            DSEInvalidArgumentException,
                            DSEInternalErrorException,
                            DSESQLException
Updates the last record of the current journal table by calling the updateRecords(String, Context, String) method.

Specified by:
updateLastRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context the context with the data
aFormatName - java.lang.String the journal format name to be used
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateLastRecord

public int updateLastRecord(Context aContext,
                            java.lang.String aFormatName,
                            Vector aColumnsVector)
                     throws DSEInvalidRequestException,
                            DSEInternalErrorException,
                            DSEInvalidArgumentException,
                            DSESQLException
Updates the columns in aColumnsVector for the last record of the current journal table by calling the updateRecords(String, Context, String, Vector) method.

Parameters:
aContext - com.ibm.dse.base.Context the context with the data
aFormatName - java.lang.String the journal format name to be used
aColumnsVector - com.ibm.dse.base.Vector the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateLastRecord

public int updateLastRecord(Hashtable aDataHashtable)
                     throws DSEInvalidRequestException,
                            DSEInvalidArgumentException,
                            DSEInternalErrorException,
                            DSESQLException
Updates the last record of the current journal table with the data in aDataHashtable. It calls the method updateRecords(String,Hashtable).

Specified by:
updateLastRecord in interface JournalService
Specified by:
updateLastRecord in class Journal
Parameters:
aDataHashtable - Hashtable the Hashtable that contains the data
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateLastRecord

public int updateLastRecord(Hashtable aDataHashtable,
                            Vector aColumnsVector)
                     throws DSEInvalidRequestException,
                            DSEInternalErrorException,
                            DSEInvalidArgumentException,
                            DSESQLException
Updates the columns in aColumnsVector for the last record of the current journal table with the data in aDataHashtable. It calls the method updateRecords(String,Hashtable,Vector).

Specified by:
updateLastRecord in interface JournalService
Parameters:
aDataHashtable - Hashtable the Hashtable that contains the data
aColumnsVector - com.ibm.dse.base.Vector the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecord

public int updateRecord(int aRecordNumber,
                        Context aContext,
                        FormatElement aHashtableFormat)
                 throws DSEInvalidRequestException,
                        DSEInternalErrorException,
                        DSEInvalidArgumentException,
                        DSESQLException
Updates the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, FormatElement) method.

Specified by:
updateRecord in class Journal
Parameters:
aRecordNumber - int the number of the record to be updated
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.client.FormatElement
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecord

public int updateRecord(int aRecordNumber,
                        Context aContext,
                        FormatElement aHashtableFormat,
                        Vector aColumnsVector)
                 throws DSEInvalidRequestException,
                        DSEInternalErrorException,
                        DSEInvalidArgumentException,
                        DSESQLException
Updates the columns in aColumnsVector for the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, FormatElement, Vector) method.

Parameters:
aRecordNumber - int the number of the record to be updated
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.client.FormatElement
aColumnsVector - com.ibm.dse.base.Vector the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecord

public int updateRecord(int aRecordNumber,
                        Context aContext,
                        java.lang.String aFormatName)
                 throws DSEInvalidRequestException,
                        DSEInvalidArgumentException,
                        DSEInternalErrorException,
                        DSESQLException
Updates the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, String) method.

Specified by:
updateRecord in class Journal
Parameters:
aRecordNumber - int the number of the record to be updated
aContext - com.ibm.dse.base.Context the context with the data
aFormatName - java.lang.String the journal format name to be used
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecord

public int updateRecord(int aRecordNumber,
                        Context aContext,
                        java.lang.String aFormatName,
                        Vector aColumnsVector)
                 throws DSEInvalidRequestException,
                        DSEInternalErrorException,
                        DSEInvalidArgumentException,
                        DSESQLException
Updates the columns in aColumnsVector for the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, String, Vector) method.

Parameters:
aRecordNumber - int the number of the record to be updated
aContext - com.ibm.dse.base.Context the context with the data
aFormatName - java.lang.String the journal format name to be used
aColumnsVector - com.ibm.dse.base.Vector the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecord

public int updateRecord(int aRecordNumber,
                        Hashtable aDataHashtable)
                 throws DSEInvalidRequestException,
                        DSEInvalidArgumentException,
                        DSEInternalErrorException,
                        DSESQLException
Updates the record identified by aRecordNumber within the journal table with the data provided in aDataHashtable by calling the updateRecords(String, Hashtable) method.

Specified by:
updateRecord in interface JournalService
Specified by:
updateRecord in class Journal
Parameters:
aRecordNumber - int the number of the record to be updated
aDataHashtable - Hashtable the Hashtable containing the new data
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecord

public int updateRecord(int aRecordNumber,
                        Hashtable aDataHashtable,
                        Vector aColumnsVector)
                 throws DSEInvalidArgumentException,
                        DSEInternalErrorException,
                        DSEInvalidRequestException,
                        DSESQLException
Updates the columns specified in aColumnsVector, for the record identified by aRecordNumber within the journal table, with the data provided in aDataHashtable. The aDataHashtable should only contain the values for the columns to be updated.

Specified by:
updateRecord in interface JournalService
Parameters:
aRecordNumber - int the number of the record to be updated
aDataHashtable - com.ibm.dse.base.Hashtable the Hashtable that contains the new data
aColumnsVector - com.ibm.dse.base.Vector the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid.
DSEInternalErrorException - if an internal program error occurs.
DSEInvalidRequestException - if the request is not valid.
com.ibm.dse.services.jdbc.DSESQLException - if an SQLException is caught.
DSEInvalidArgumentException
DSEInternalErrorException
DSEInvalidRequestException
DSESQLException

updateRecords

public int updateRecords(java.lang.String aSearchCondition,
                         Context aContext,
                         FormatElement aHashtableFormat)
                  throws DSEInvalidRequestException,
                         DSEInternalErrorException,
                         DSEInvalidArgumentException,
                         DSESQLException
Updates all the current journal table records that match the search condition passed as an argument, with the data obtained by formatting aContext with the journal aHashtableFormat formatter.

Specified by:
updateRecords in class Journal
Parameters:
aSearchCondition - java.lang.String
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.client.FormatElement
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecords

public int updateRecords(java.lang.String aSearchCondition,
                         Context aContext,
                         FormatElement aHashtableFormat,
                         Vector aColumnsVector)
                  throws DSEInvalidRequestException,
                         DSEInternalErrorException,
                         DSEInvalidArgumentException,
                         DSESQLException
Updates the columns specified in aColumnsVector for all the current journal table records that match the search condition passed as an argument, with the data obtained by formatting aContext with the journal formatter aHashtableFormat.

Parameters:
aSearchCondition - java.lang.String
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.btt.formatter.client.FormatElement
aColumnsVector - com.ibm.dse.base.Vector - the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecords

public int updateRecords(java.lang.String aSearchCondition,
                         Context aContext,
                         java.lang.String aFormatName)
                  throws DSEInvalidRequestException,
                         DSEInvalidArgumentException,
                         DSEInternalErrorException,
                         DSESQLException
Updates all the current journal table records that match the search condition passed as an argument, with the data obtained by formatting aContext with the formatter defined by aFormatName.

Specified by:
updateRecords in class Journal
Parameters:
aSearchCondition - java.lang.String the search condition
aContext - com.ibm.dse.base.Context the context with the data
aFormatName - java.lang.String the journal format name that defines the formatter to be used
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecords

public int updateRecords(java.lang.String aSearchCondition,
                         Context aContext,
                         java.lang.String aFormatName,
                         Vector aColumnsVector)
                  throws DSEInvalidRequestException,
                         DSEInternalErrorException,
                         DSEInvalidArgumentException,
                         DSESQLException
Updates the columns specified in aColumnsVector for all the current journal table records that match the search condition passed as an argument, with the data obtained by formatting aContext with the formatter defined by aFormatName.

Parameters:
aSearchCondition - java.lang.String the search condition
aContext - com.ibm.dse.base.Context the context with the data
aFormatName - java.lang.String the journal format name that defines the formatter to be used
aColumnsVector - com.ibm.dse.base.Vector - the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecords

public int updateRecords(java.lang.String aSearchCondition,
                         Hashtable aDataHashtable)
                  throws DSEInvalidRequestException,
                         DSEInternalErrorException,
                         DSEInvalidArgumentException,
                         DSESQLException
Updates all the current journal table records that match the search condition with the aDataHashtable data.

Specified by:
updateRecords in interface JournalService
Specified by:
updateRecords in class Journal
Parameters:
aSearchCondition - java.lang.String the search condition
aDataHashtable - Hashtable the Hashtable that contains the new data
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

updateRecords

public int updateRecords(java.lang.String aSearchCondition,
                         Hashtable aDataHashtable,
                         Vector aColumnsVector)
                  throws DSEInvalidArgumentException,
                         DSEInternalErrorException,
                         DSEInvalidRequestException,
                         DSESQLException
Updates the columns specified in aColumnsVector with the data provided in aDataHashtable for the records matching the search condition within the journal table. The aDataHashtable should only contain the values for the columns to be updated.

Specified by:
updateRecords in interface JournalService
Parameters:
aSearchCondition - java.lang.String the search condition
aDataHashtable - com.ibm.dse.base.Hashtable the Hashtable that contains the new data
aColumnsVector - com.ibm.dse.base.Vector the columns to be changed
Returns:
int - the row count ( number of updated records)
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid.
DSEInternalErrorException - if an internal program error occurs.
DSEInvalidRequestException - if the request is not valid.
com.ibm.dse.services.jdbc.DSESQLException - if an SQLException is caught.
DSEInvalidArgumentException
DSEInternalErrorException
DSEInvalidRequestException
DSESQLException

disconnect

public void disconnect()
                throws DSESQLException,
                       DSEException
Disconnect database.

Specified by:
disconnect in interface DatabaseConnect
Overrides:
disconnect in class JDBCService
Throws:
DSESQLException - Thrown when the disconnect fails
DSEException - if an exception is thrown when calling the pool of connections manager

connect

public void connect(java.lang.String anUser,
                    java.lang.String aPwd)
             throws DSESQLException,
                    DSEException
Disconnect database.

Specified by:
connect in interface DatabaseConnect
Overrides:
connect in class JDBCService
Parameters:
anUser - java.lang.String - the user identification
aPwd - java.lang.String - the user password
Throws:
DSESQLException - Thrown when the disconnect fails
DSEException - if an exception is thrown when calling the pool of connections manager

close

public void close()
           throws DSESQLException,
                  DSEInternalErrorException
Closes the journal (sets its status to inactive). No more journaling operations can be performed on it.

Specified by:
close in interface JournalService
Specified by:
close in class Journal
Throws:
DSESQLException - if the close fails
DSEInternalErrorException

setEntity

public void setEntity(java.lang.String anEntityName)
               throws DSEInternalErrorException
Sets the entity property value to anEntityName.

Specified by:
setEntity in interface JournalService
Parameters:
anEntityName - java.lang.String
Throws:
DSEInternalErrorException

open

public void open(java.lang.String anEntity,
                 int aGeneration)
          throws DSEInvalidRequestException,
                 DSEInternalErrorException,
                 DSESQLException
Opens the journal service with an entity and a generation number

Specified by:
open in interface JournalService
Parameters:
anEntity - java.lang.String
aGeneration - int
Throws:
DSEInvalidRequestException - if journal service state is active
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

open

public void open(java.lang.String aSchemaName,
                 java.lang.String anEntity,
                 int aGeneration)
          throws DSEInvalidRequestException,
                 DSEInternalErrorException,
                 DSESQLException
Opens the journal service with a specific shema, an entity, and a generation number.

Specified by:
open in interface JournalService
Parameters:
aSchemaName - java.lang.String
anEntity - java.lang.String
aGeneration - int
Throws:
DSEInvalidRequestException - if journal service state is active
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

openForEntity

public void openForEntity(java.lang.String anEntity,
                          java.lang.String aSchemaName)
                   throws DSEInternalErrorException,
                          DSEInvalidRequestException,
                          DSEInvalidArgumentException,
                          DSESQLException
Decides which is going to be the current journal table for anEntity. It sets the entity property to anEntity, the schemaName attribute to aSchemaName, and calls the open() method.

Specified by:
openForEntity in interface JournalService
Parameters:
anEntity - java.lang.String, the name of the entity
aSchemaName - java.lang.String, the name of the schema
Throws:
DSEInvalidRequestException - if the entity name is not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if an argument is not valid
DSESQLException - if a SQLException occurs

openForEntity

public void openForEntity(java.lang.String anEntity)
                   throws DSEInternalErrorException,
                          DSEInvalidRequestException,
                          DSEInvalidArgumentException,
                          DSESQLException
Opens the current journal table for anEntity. It sets the entity property to anEntity and calls the open() method.

Specified by:
openForEntity in interface JournalService
Parameters:
anEntity - java.lang.String, the name of the entity
Throws:
DSEInvalidRequestException - if the entity name is not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if an argument is not valid
DSESQLException - if a SQLException occurs

openForSchema

public void openForSchema(java.lang.String aSchemaName)
                   throws DSEInternalErrorException,
                          DSEInvalidRequestException,
                          DSEInvalidArgumentException,
                          DSESQLException
Decides which is going to be the current journal table. It sets the schemaName property to aSchemaName and calls the open() method.

Specified by:
openForSchema in interface JournalService
Parameters:
aSchemaName - java.lang.String, the name of the schema
Throws:
DSEInvalidRequestException - if the entity name is not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if an argument is not valid
DSESQLException - if a SQLException occurs

getLastRecordNumberFromTable

public int getLastRecordNumberFromTable()
                                 throws DSEInvalidRequestException
Returns the lastRecordNumber from control table. In this method, all accesses are exclusive.

Specified by:
getLastRecordNumberFromTable in interface JournalService
Returns:
int
Throws:
DSEInvalidRequestException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005