com.ibm.dse.services.jdbc
Class JDBCJournal

java.lang.Object
  |
  +--com.ibm.dse.base.DSENotifier
        |
        +--com.ibm.dse.base.Service
              |
              +--com.ibm.dse.services.jdbc.JDBCService
                    |
                    +--com.ibm.dse.services.jdbc.Journal
                          |
                          +--com.ibm.dse.services.jdbc.JDBCJournal
Direct Known Subclasses:
SingleTableJournal

public class JDBCJournal
extends Journal

The JDBCJournal class is a concrete class that provides an implementation of the Journal abstraction (a financial electronic journal). The JDBCJournal uses the JDBC interface to access the database and then can be used with any DBMS providing an implementation of this interface.

See Also:
Serialized Form

Field Summary
protected  boolean createSchema
          Keeps whether the journal schema was also created in the database or not.
protected  java.lang.String JDBCDriver
          Keeps the name of the JDBC driver to be used to access the database.
protected  java.lang.String schemaName
          Keeps the name of the schema where all journal tables are defined.
protected  java.lang.String tableName
          Keeps the table name which is schemaName.entity_wrapNumber
 
Fields inherited from class com.ibm.dse.services.jdbc.Journal
COMPID, date, entity, lastRecordNumber
 
Fields inherited from class com.ibm.dse.services.jdbc.JDBCService
autoCommit, connectionProperties, databaseConnection, databaseURL, dataSourceName, metaData, password, poolName, sharedConnection, user, waitRetry
 
Fields inherited from class com.ibm.dse.base.Service
externalizer
 
Fields inherited from class com.ibm.dse.base.DSENotifier
handlersList, name
 
Constructor Summary
JDBCJournal()
          This constructor creates a JDBCJournal object.
JDBCJournal(java.lang.String anEntityName, java.lang.String aSchemaName)
          This constructor creates a JDBCJournal object.
 
Method Summary
 int addRecord(Context aContext, HashtableFormat aHashtableFormat)
          Calls the formatter (HashtableFormat parameter) 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.
protected  void buildConnectionProperties()
          Build the hashtable containing all details needed to request the database connection.
 void commit()
          Commits all changes to the database.
protected  java.lang.String controlTableName()
          Returns the current control table name.
 java.sql.Date currentGenerationDate()
          Returns the last date that the journal service was used by a specific entity to the journal instance as soon as it is created.
protected  int currentWrapNumber()
          Returns the current table generation number being used by the journal instance for the schema set in the schemaName attribute.
protected  int currentWrapNumberForSchema(java.lang.String aSchemaName)
          Returns the current table generation number being used by the journal instance for the schema aSchemaName.
protected  void deleteJournalContent(int aGeneration)
          Internally used to delete the contents of a current journal table.
protected  void deleteRecord(int aRecordNumber)
          Internally used to delete a record in the current journal table
 Hashtable getColumnsTable()
          Returns the columnsTable attribute value of the current journal.
protected  java.sql.Connection getDatabaseConnection()
          Returns the databaseConnection attribute value.
 Vector getEntities()
          Retrieves all entities from the Database.
 java.lang.String getJDBCDriver()
          Returns the JDBCDriver attribute value.
 int getNumberOfGenerations()
          Returns the number of journal generations.
 java.lang.String getSchemaName()
          Returns the schemaName attribute value.
 java.lang.String getTableName()
          Returns the current journal tableName.
protected  int getWrapNumber()
          Returns the wrapNumber attribute value
 java.lang.Object initializeColumnFrom(Tag aTag)
          Used by the JDBCJournal service externalizer to create the contents of the columnsTable instance attribute.
 java.lang.Object initializeFrom(Tag aTag)
          Used by the services externalizer to set the JDBCJournal instance attributes as defined in the XML file.
 boolean isConnected()
          Returns true if there is a connection to the database or false if there is not.
 boolean isCreateSchema()
          Returns the createSchema attribute value.
 boolean isValidEntity()
          Returns true if the entity set for the current journal is valid or false if it is not.
 void loadDriver()
          Loads the JDBC Driver given in the external definition of the service or the default JDBC Driver as set in the JournalConstants EJ_DEFAULT_JDBCDRIVER attribute.
 void loadDriver(java.lang.String aDriverName)
          Loads the JDBC Driver explicitly provided as an argument.
static JDBCJournal newFor(java.lang.String anEntityName, java.lang.String aSchemaName)
          Returns a new JDBCJournal instance with the entityName and schemaName attributes set to the provided values.
protected  int nextWrapNumber()
          Returns the next generation number to be used for the default schema.
protected  int nextWrapNumberForSchema(java.lang.String aSchemaName)
          Returns the next generation number available for the specified schema
 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 an specific shema, an entity and a generation number
 void openForEntity(java.lang.String anEntity)
          Decides which is going to be the current journal table for entity anEntity.
 void openForEntity(java.lang.String anEntity, java.lang.String aSchemaName)
          Decides which is going to be the current journal table for entity 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 openOnCurrentTableForSchema(java.lang.String aSchemaName)
          Selects the already selected table generation for the specified schema as the current journal table.
 void openOnNextTable()
          Selects the next available table generation for the current schema as the current journal table.
 void openOnNextTableForSchema(java.lang.String aSchemaName)
          Selects the next available table generation for the specified 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, HashtableFormat aHashtableFormat)
          Retrieves the last record of the current journal table by calling the retrieveRecord(int, Context, HashtableFormat) with the last record number as 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) with the last record number as first parameter.
 Vector retrieveLastRecords(int aNumber)
          It returns a vector with aNumber or any number between 0 and aNumber of hashtables with the records information.
 void retrieveLastRecords(int aNumber, Context aContext, HashtableIndexedCollectionFormat anOutputFormat)
          Retrieves the last aNumber records from the journal table and unformats them into the context aContext using the formatter anOutputFormat.
 void retrieveLastRecords(int aNumber, Context aContext, java.lang.String anOutputFormatName)
          Retrieves the last aNumber records from the journal table and unformats them into the context aContext using the formatter named anOutputFormatName.
 Hashtable retrieveRecord(int aRecordNumber)
          Retrieves the record with record identification in the database equal to aRecordNumber.
 void retrieveRecord(int aRecordNumber, Context aContext, HashtableFormat 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, HashtableIndexedCollectionFormat 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, HashtableIndexedCollectionFormat 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.
protected  void setColumnsTable(Hashtable aColumnsHashtable)
          Sets the columnsTable attribute to aColumnsHashtable value.
 void setCreateSchema(boolean newCreateSchema)
          Sets the createSchema attribute to newCreateSchema.
protected  void setDatabaseConnection(java.sql.Connection aDatabaseConnection)
          Sets the database connection attribute to aDatabaseConnection.
 void setEntity(java.lang.String anEntityName)
          Sets the entity attribute value to anEntityName.
 void setJDBCDriver(java.lang.String newJDBCDriver)
          Sets the JDBCDriver attribute value to newJDBCDriver.
 void setSchemaName(java.lang.String aSchemaName)
          Sets the schemaName attribute to aSchemaName
protected  void setTableName(java.lang.String aTableName)
          Sets the tableName.
protected  java.lang.String tableName(java.lang.String aSchemaName, java.lang.String anEntityName, int aGeneration)
          Returns the journal table name for a specific schema name, entity name and generation.
 Vector toStrings()
          Used by the Db2Journal service externalizer.
 int updateLastRecord(Context aContext, HashtableFormat aHashtableFormat)
          Updates the last record of the current journal table by calling the updateRecords(String, Context, HashtableFormat) method.
 int updateLastRecord(Context aContext, HashtableFormat aHashtableFormat, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector for the last record of the current journal table by calling the updateRecords(String, Context, HashtableFormat, 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, HashtableFormat aHashtableFormat)
          Updates the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, HashtableFormat) method.
 int updateRecord(int aRecordNumber, Context aContext, HashtableFormat aHashtableFormat, Vector aColumnsVector)
          Updates the columns in aColumnsVector for the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, HashtableFormat, 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, HashtableFormat 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 formatter aHashtableFormat.
 int updateRecords(java.lang.String aSearchCondition, Context aContext, HashtableFormat 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 for the records matching the search condition within the journal table, with the data provided in aDataHashtable.
 
Methods inherited from class com.ibm.dse.services.jdbc.Journal
close, getDate, getEntity, getLastRecordNumber, getState, isActive, open, setLastRecordNumber, setState, today
 
Methods inherited from class com.ibm.dse.services.jdbc.JDBCService
connect, connect, connect, connect, connect, connect, disconnect, getAutoCommit, getConnectionManager, getConnectionProperties, getDatabaseURL, getDataSourceName, getPassword, getPoolName, getSharedConnection, getUser, isWaitRetry, requestConnectionToConnectionManager, requestConnectionToConnectionManager, setAutoCommit, setConnectionManager, setConnectionProperties, setDatabaseURL, setDataSourceName, setPassword, setPoolName, setSharedConnection, setUser, setWaitRetry, verifyConnection
 
Methods inherited from class com.ibm.dse.base.Service
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, terminate, toString, toTags, writeExternal, writeExternal
 
Methods inherited from class com.ibm.dse.base.DSENotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JDBCDriver

protected java.lang.String JDBCDriver
Keeps the name of the JDBC driver to be used to access the database.

createSchema

protected boolean createSchema
Keeps whether the journal schema was also created in the database or not.

schemaName

protected java.lang.String schemaName
Keeps the name of the schema where all journal tables are defined.

tableName

protected java.lang.String tableName
Keeps the table name which is schemaName.entity_wrapNumber
Constructor Detail

JDBCJournal

public JDBCJournal()
This constructor creates a JDBCJournal object.

JDBCJournal

public JDBCJournal(java.lang.String anEntityName,
                   java.lang.String aSchemaName)
            throws DSEInvalidRequestException
This constructor creates a JDBCJournal object. It sets the entityName and the schemaName attributes to the values passed as arguments.
Parameters:
anEntityName - java.lang.String the Entity name
aSchemaName - java.lang.String the Schema name
Throws:
DSEInvalidRequestException - if the request is not valid
Method Detail

addRecord

public int addRecord(Context aContext,
                     HashtableFormat aHashtableFormat)
              throws DSEInvalidArgumentException,
                     DSEInvalidRequestException,
                     DSEInternalErrorException,
                     DSESQLException
Calls the formatter (HashtableFormat parameter) 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.
Overrides:
addRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.dse.base.HashtableFormat
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.
Overrides:
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
Overrides:
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

buildConnectionProperties

protected void buildConnectionProperties()
Build the hashtable containing all details needed to request the database connection. It is called by the initializeFrom() method
Overrides:
buildConnectionProperties in class JDBCService

commit

public void commit()
            throws DSESQLException
Commits all changes to the database. If the autoCommit attribute is set to true, it does nothing.
Overrides:
commit in class Journal
Throws:
DSESQLException - if commit failed

controlTableName

protected java.lang.String controlTableName()
Returns the current control table name. The control table is a specific table within the journal schema that is internally used by the journal service to keep information about entities and the number of generations of the journalling system. The control table name can be modified by changing the CONTROL_TABLE_NAME attribute in the JournalConstants class.
Overrides:
controlTableName in class Journal
Returns:
String

currentGenerationDate

public java.sql.Date currentGenerationDate()
                                    throws DSEInternalErrorException,
                                           DSESQLException
Returns the last date that the journal service was used by a specific entity to the journal instance as soon as it is created. When a journal is opened, this date and the currentJournallingDate (usually today's date) are compared. If the latter is greater, then a new table generation is selected and is used for that specific entity (and eventually the oldest generation is deleted if the maximum number of generations has been exceeded); if both dates are equal, then the current table generation is used.
Overrides:
currentGenerationDate in class Journal
Returns:
java.sql.Date - the current generation date
Throws:
DSEInternalErrorException - if an internal Program error is detected
DSESQLException - if a SQLException occurs

currentWrapNumber

protected int currentWrapNumber()
                         throws DSEInternalErrorException,
                                DSEInvalidRequestException,
                                DSEInvalidArgumentException,
                                DSESQLException
Returns the current table generation number being used by the journal instance for the schema set in the schemaName attribute.
Returns:
int - the current wrap number
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

currentWrapNumberForSchema

protected int currentWrapNumberForSchema(java.lang.String aSchemaName)
                                  throws DSEInternalErrorException,
                                         DSEInvalidRequestException,
                                         DSEInvalidArgumentException,
                                         DSESQLException
Returns the current table generation number being used by the journal instance for the schema aSchemaName.
Parameters:
aSchemaName - java.lang.String, the journal schema name
Returns:
int - the current wrap number
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

deleteJournalContent

protected void deleteJournalContent(int aGeneration)
                             throws DSEInternalErrorException,
                                    DSESQLException
Internally used to delete the contents of a current journal table.
Parameters:
aGeneration - int
Throws:
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

deleteRecord

protected void deleteRecord(int aRecordNumber)
                     throws DSEInternalErrorException,
                            DSESQLException
Internally used to delete a record in the current journal table
Parameters:
aRecordNumber - int
Throws:
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

getColumnsTable

public Hashtable getColumnsTable()
Returns the columnsTable attribute value of the current journal.
Returns:
Hashtable - the Hashtable that holds the column information

getDatabaseConnection

protected java.sql.Connection getDatabaseConnection()
Returns the databaseConnection attribute value.
Overrides:
getDatabaseConnection in class JDBCService
Returns:
Connection - the connection to the database

getEntities

public Vector getEntities()
                   throws DSESQLException,
                          DSEInternalErrorException
Retrieves all entities from the Database.
Returns:
com.ibm.dse.base.Vector, the vector containing all journal entities
Throws:
DSESQLException - if an SQLException is caught
DSEInternalErrorException - if an internal program error occurs

getJDBCDriver

public java.lang.String getJDBCDriver()
Returns the JDBCDriver attribute value.
Overrides:
getJDBCDriver in class Journal
Returns:
java.lang.String

getNumberOfGenerations

public int getNumberOfGenerations()
                           throws DSESQLException,
                                  DSEInternalErrorException
Returns the number of journal generations.
Returns:
int
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

getSchemaName

public java.lang.String getSchemaName()
Returns the schemaName attribute value.
Overrides:
getSchemaName in class Journal
Returns:
java.lang.String - the journal schema name

getTableName

public java.lang.String getTableName()
Returns the current journal tableName.
Overrides:
getTableName in class Journal
Returns:
java.lang.String

getWrapNumber

protected int getWrapNumber()
Returns the wrapNumber attribute value
Returns:
int - the wrap number

initializeColumnFrom

public java.lang.Object initializeColumnFrom(Tag aTag)
Used by the JDBCJournal service externalizer to create the contents of the columnsTable instance attribute. The columnsTable is a hashtable with a key that is the column name and a value that is the data field name for the context whose value corresponds to that column in the database journal table.
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException
Used by the services externalizer to set the JDBCJournal instance attributes as defined in the XML file.
Overrides:
initializeFrom in class Service
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object
Throws:
java.io.IOException - if an I/O exception occurs.

isConnected

public boolean isConnected()
                    throws DSEInvalidRequestException,
                           DSEInternalErrorException,
                           DSESQLException,
                           DSEObjectNotFoundException,
                           DSEException
Returns true if there is a connection to the database or false if there is not.
Overrides:
isConnected in class JDBCService
Returns:
boolean
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught

isCreateSchema

public boolean isCreateSchema()
Returns the createSchema attribute value. It is true if a database schema has been created for the journal schema.
Overrides:
isCreateSchema in class Journal
Returns:
boolean

isValidEntity

public boolean isValidEntity()
                      throws DSEInternalErrorException,
                             DSESQLException
Returns true if the entity set for the current journal is valid or false if it is not. It accesses the journal control table to check if there is a row with an ENTITY_NAME column value that matches the journal instance entity name.
Overrides:
isValidEntity in class Journal
Returns:
boolean
Throws:
DSEInternalErrorException - if an internal program error is detected
DSESQLException - if a SQLException is caught

loadDriver

public void loadDriver()
                throws DSEInternalErrorException
Loads the JDBC Driver given in the external definition of the service or the default JDBC Driver as set in the JournalConstants EJ_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

newFor

public static JDBCJournal newFor(java.lang.String anEntityName,
                                 java.lang.String aSchemaName)
                          throws DSEInvalidRequestException
Returns a new JDBCJournal instance with the entityName and schemaName attributes set to the provided values.
Parameters:
anEntityName - java.lang.String, the name of the Entity
aSchemaName - java.lang.String, the name of the Schema
Returns:
JDBCJournal - the new JDBCJournal instance
Throws:
DSEInvalidRequestException - if the request is not valid

nextWrapNumber

protected int nextWrapNumber()
                      throws DSEInternalErrorException,
                             DSEInvalidRequestException,
                             DSEInvalidArgumentException,
                             DSESQLException
Returns the next generation number to be used for the default schema.
Returns:
int - the next wrap number
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

nextWrapNumberForSchema

protected int nextWrapNumberForSchema(java.lang.String aSchemaName)
                               throws DSEInternalErrorException,
                                      DSEInvalidRequestException,
                                      DSEInvalidArgumentException,
                                      DSESQLException
Returns the next generation number available for the specified schema
Parameters:
aSchemaName - java.lang.String, the journal schema name
Returns:
int - the generation number
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

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
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 an specific shema, an entity and a generation number
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)
                   throws DSEInternalErrorException,
                          DSEInvalidRequestException,
                          DSEInvalidArgumentException,
                          DSESQLException
Decides which is going to be the current journal table for entity anEntity. It sets the entity attribute to anEntity and calls the open() method.
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

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 entity anEntity. It sets the entity attribute to anEntity and the schemaName attribute to aSchemaName, and calls the open() method.
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

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 attribute to aSchemaName and calls the open() method.
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

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.
Overrides:
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

openOnCurrentTableForSchema

public void openOnCurrentTableForSchema(java.lang.String aSchemaName)
                                 throws DSEInvalidRequestException,
                                        DSEInternalErrorException,
                                        DSEInvalidArgumentException,
                                        DSESQLException
Selects the already selected table generation for the specified schema as the current journal table. It sets the journal attributes to a value that is adequate to start working with this table.
Parameters:
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 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.
Overrides:
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

openOnNextTableForSchema

public void openOnNextTableForSchema(java.lang.String aSchemaName)
                              throws DSEInternalErrorException,
                                     DSEInvalidRequestException,
                                     DSEInvalidArgumentException,
                                     DSESQLException
Selects the next available table generation for the specified schema as the current journal table. It sets the journal attributes to a value that is adequate to start working with this table.
Parameters:
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 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.
Overrides:
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.
Overrides:
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,
                               HashtableFormat aHashtableFormat)
                        throws DSEInvalidRequestException,
                               DSEInternalErrorException,
                               DSEInvalidArgumentException,
                               DSESQLException
Retrieves the last record of the current journal table by calling the retrieveRecord(int, Context, HashtableFormat) with the last record number as first parameter.
Overrides:
retrieveLastRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.dse.base.HashtableFormat
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) with the last record number as first parameter.
Overrides:
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 aNumber)
                           throws DSEInternalErrorException,
                                  DSEInvalidArgumentException,
                                  DSEInvalidRequestException,
                                  DSESQLException
It returns a vector with aNumber or any number between 0 and aNumber of hashtables with the records information.
Overrides:
retrieveLastRecords in class Journal
Parameters:
aNumber - 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 aNumber,
                                Context aContext,
                                HashtableIndexedCollectionFormat anOutputFormat)
                         throws DSEInternalErrorException,
                                DSEInvalidArgumentException,
                                DSEInvalidRequestException,
                                DSESQLException,
                                DSEObjectNotFoundException
Retrieves the last aNumber records from the journal table and unformats them into the context aContext using the formatter anOutputFormat.
Parameters:
aNumber - 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.dse.base.HashtableIndexedCollectionFormat, 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

retrieveLastRecords

public void retrieveLastRecords(int aNumber,
                                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 context aContext using the formatter named anOutputFormatName.
Parameters:
aNumber - 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

retrieveRecord

public Hashtable retrieveRecord(int aRecordNumber)
                         throws DSEInternalErrorException,
                                DSEInvalidArgumentException,
                                DSESQLException
Retrieves the record with record identification in the database equal to aRecordNumber.
Overrides:
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,
                           HashtableFormat 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 the Context aContext is updated with the result of unformatting that Hashtable with the formatter aHashtableFormat.
Overrides:
retrieveRecord in class Journal
Parameters:
aRecordNumber - int
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.dse.base.HashtableFormat
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 the Context aContext is updated with the result of unformatting that Hashtable with the formatter defined by aFormatName.
Overrides:
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.
Overrides:
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,
                            HashtableIndexedCollectionFormat 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.dse.base.HashtableIndexedCollectionFormat, 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

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

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.
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,
                            HashtableIndexedCollectionFormat 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.dse.base.HashtableIndexedCollectionFormat, 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
Rolls back all database changes.
Overrides:
rollback in class Journal
Throws:
DSESQLException - when rollback fails

setColumnsTable

protected void setColumnsTable(Hashtable aColumnsHashtable)
Sets the columnsTable attribute to aColumnsHashtable value. The columns hashtable has the following format: key=column_name, value=data_field_name
Parameters:
aColumnsHashtable - Hashtable

setCreateSchema

public void setCreateSchema(boolean newCreateSchema)
Sets the createSchema attribute to newCreateSchema.
Overrides:
setCreateSchema in class Journal
Parameters:
newCreateSchema - boolean

setDatabaseConnection

protected void setDatabaseConnection(java.sql.Connection aDatabaseConnection)
Sets the database connection attribute to aDatabaseConnection.
Overrides:
setDatabaseConnection in class JDBCService
Parameters:
aDatabaseConnection - Connection

setEntity

public void setEntity(java.lang.String anEntityName)
Sets the entity attribute value to anEntityName.
Overrides:
setEntity in class Journal
Parameters:
anEntityName - java.lang.String

setJDBCDriver

public void setJDBCDriver(java.lang.String newJDBCDriver)
Sets the JDBCDriver attribute value to newJDBCDriver.
Overrides:
setJDBCDriver in class Journal
Parameters:
newJDBCDriver - java.lang.String

setSchemaName

public void setSchemaName(java.lang.String aSchemaName)
Sets the schemaName attribute to aSchemaName
Overrides:
setSchemaName in class Journal
Parameters:
aSchemaName - java.lang.String, the journal schema name

setTableName

protected void setTableName(java.lang.String aTableName)
Sets the tableName.
Overrides:
setTableName in class Journal
Parameters:
aTableName - java.lang.String

tableName

protected java.lang.String tableName(java.lang.String aSchemaName,
                                     java.lang.String anEntityName,
                                     int aGeneration)
Returns the journal table name for a specific schema name, entity name and generation.
Parameters:
aSchemaName - java.lang.String, the schema name
anEntityName - java.lang.String, the entity name
aGeneration - int, the generation number
Returns:
java.lang.String

toStrings

public Vector toStrings()
Used by the Db2Journal service externalizer.
Overrides:
toStrings in class Service
Returns:
com.ibm.dse.base.Vector

updateLastRecord

public int updateLastRecord(Context aContext,
                            HashtableFormat aHashtableFormat)
                     throws DSEInvalidRequestException,
                            DSEInternalErrorException,
                            DSEInvalidArgumentException,
                            DSESQLException
Updates the last record of the current journal table by calling the updateRecords(String, Context, HashtableFormat) method.
Overrides:
updateLastRecord in class Journal
Parameters:
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.dse.base.HashtableFormat
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,
                            HashtableFormat 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, HashtableFormat, Vector) method.
Parameters:
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.dse.base.HashtableFormat
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,
                            DSEInternalErrorException,
                            DSEInvalidArgumentException,
                            DSESQLException
Updates the last record of the current journal table by calling the updateRecords(String, Context, String) method.
Overrides:
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,
                            DSEInternalErrorException,
                            DSEInvalidArgumentException,
                            DSESQLException
Updates the last record of the current journal table with the data in aDataHashtable. It calls the method updateRecords(String,Hashtable).
Overrides:
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).
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,
                        HashtableFormat aHashtableFormat)
                 throws DSEInvalidRequestException,
                        DSEInternalErrorException,
                        DSEInvalidArgumentException,
                        DSESQLException
Updates the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, HashtableFormat) method.
Overrides:
updateRecord in class Journal
Parameters:
aRecordNumber - int, the number of the record to be updated
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.dse.base.HashtableFormat
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,
                        HashtableFormat 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, HashtableFormat, Vector) method.
Parameters:
aRecordNumber - int, the number of the record to be updated
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.dse.base.HashtableFormat
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,
                        DSEInternalErrorException,
                        DSEInvalidArgumentException,
                        DSESQLException
Updates the record identified by aRecordNumber within the journal table by calling the updateRecords(String, Context, String) method.
Overrides:
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,
                        DSEInternalErrorException,
                        DSEInvalidArgumentException,
                        DSESQLException
Updates the record identified by aRecordNumber within the journal table with the data provided in aDataHashtable by calling the updateRecords(String, Hashtable) method.
Overrides:
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. aDataHashtable should only contain the values for the columns to be updated.
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.
DSESQLException - if an SQLException is caught.

updateRecords

public int updateRecords(java.lang.String aSearchCondition,
                         Context aContext,
                         HashtableFormat 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 formatter aHashtableFormat.
Overrides:
updateRecords in class Journal
Parameters:
aSearchCondition - java.lang.String
aContext - com.ibm.dse.base.Context
aHashtableFormat - com.ibm.dse.base.HashtableFormat
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,
                         HashtableFormat 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.dse.base.HashtableFormat
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,
                         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 formatter defined by aFormatName.
Overrides:
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.
Overrides:
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 for the records matching the search condition within the journal table, with the data provided in aDataHashtable. aDataHashtable should only contain the values for the columns to be updated.
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.
DSESQLException - if an SQLException is caught.