IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.services.jdbctableservice
Class JDBCTableServiceImpl

java.lang.Object
  extended bycom.ibm.btt.base.Service
      extended bycom.ibm.btt.services.BTTServiceImpl
          extended bycom.ibm.btt.services.PoolableServiceImpl
              extended bycom.ibm.btt.services.jdbcservicesinfra.JDBCServiceImpl
                  extended bycom.ibm.btt.services.jdbctableservice.JDBCTableServiceImpl
All Implemented Interfaces:
BTTService, DatabaseConnect, Externalizable, java.io.Externalizable, Poolable, java.io.Serializable, TableService

public class JDBCTableServiceImpl
extends JDBCServiceImpl
implements TableService, Poolable

The JDBCTable class provides the interface to access any database table. It can use, as the underlying data store, any DBMS that implements the JDBC protocol.

See Also:
Serialized Form

Field Summary
protected  boolean autoConnect
          Keeps the connection criteria that the JDBCTable service must follow.
protected  java.lang.String catalog
          The name of database catalog where the table is created.
protected  Hashtable columnsTable
          Contains information about the relationship between a column in the database table and a data field in the context.
static java.lang.String COMPID
          Keeps the component identification that will be used by the traces tool.
protected  java.lang.String JDBCDriver
          Keeps the name of the JDBC driver to be used to access the database.
protected  boolean primaryKeys
          Keeps whether the service must prevent the application from modify a primary key when updating a record (the service will automatically remove any column set in the update statement that is a primary key for the table) or the application itself will take care of this issue and then the service will throw an exception if the application tries to update a primary key.
protected  Hashtable primaryKeysHashtable
          Keeps the table primary keys for all the tables being accessed using a JDBCTable instance.
protected  java.lang.String schema
          The name of database schema where the table is created.
protected  java.lang.String tableName
          The name of the table the JDBCTable service will work with.
protected static Hashtable tablesMetaData
          Keeps the table meta data information for all the tables being accessed using a JDBCTable instance.
 
Fields inherited from class com.ibm.btt.services.jdbcservicesinfra.JDBCServiceImpl
addPstmt, addString, autoCommit, connectionProperties, databaseConnection, databaseURL, dataSourceName, metaData, operationtime, password, poolName, sharedConnection, STMT_POOL_SIZE_DEFAULT, stmtPool, stmtPoolSize, updateString, user, waitRetry
 
Fields inherited from class com.ibm.btt.services.BTTServiceImpl
DEFAULT_RESPONSE
 
Fields inherited from class com.ibm.btt.base.Service
externalizer, name
 
Constructor Summary
JDBCTableServiceImpl()
          This constructor creates a JDBCTableService object.
 
Method Summary
 void addRecord(Context aContext, FormatElement aHashtableFormat)
          Calls the format method of the hashtable formatter aHashtableFormat by passing the aContext context as an argument.
 void addRecord(Context aContext, FormatElement aHashtableFormat, Vector aColumnsVector)
          Calls the format method of the hashtable formatter aHashtableFormat by passing the aContext context as an argument.
 void addRecord(Context aContext, java.lang.String aFormatName)
          Instantiates the table format named aFormatName and calls its format method by passing the aContext as an argument.
 void addRecord(Context aContext, java.lang.String aFormatName, Vector aColumnsVector)
          Instantiates the table format named aFormatName and calls its format method by passing the aContext context as an argument.
 void addRecord(Hashtable aDataHashtable)
          Inserts the data from aDataHashtable as a new row into the table assigned to the table service.
 void addRecord(Hashtable aDataHashtable, Vector aColumnsVector)
          Inserts a record in the database only passing values to the columns specified in aColumnsVector.
 void buildAddString()
          Builds an instance variable that is used when adding a records.
 void buildAddString(Vector aColumnsVector)
          Builds an instance variable that is used when adding a record with only specific columns values set by the application.
protected  void buildConnectionProperties()
          Build the Hashtable containing all details needed to request the database connection.
 void buildUpdateString()
          Builds an instance variable that is used when updating all columns of a record.
 void commit()
          Commits all changes to the database.
 void connect(java.lang.String aUser, java.lang.String aPassword)
          Connects to the Database set in the DataSource definition using aUser and aPassword.
 void deleteRecordsMatching(java.lang.String aSearchCondition)
          Deletes the records in the table that match the search criteria.
 void disconnect()
          Closes the database connection.
 void executeProcedure(java.lang.String procedureName, Context aContext, FormatElement aHashtableInputFormat)
          Builds a data Hashtable by calling the format method of the aHashtableInputFormat with the aContext as an argument.
 void executeProcedure(java.lang.String procedureName, Context aContext, FormatElement aHashtableInputFormat, FormatElement aHashtableOutputFormat)
          Builds a data Hashtable by calling the format method of the aHashtableFormat with the aContext as an argument.
 void executeProcedure(java.lang.String procedureName, Context aContext, FormatElement aHashtableInputFormat, java.lang.String aHashtableOutputFormatName)
          Builds a data Hashtable by calling the format method of the aHashtableFormat with the aContext as an argument.
 void executeProcedure(java.lang.String procedureName, Context aContext, Hashtable dataHashtable, FormatElement aHashtableOutputFormat)
          Executes the stored procedure procedureName with the parameters given in the dataHashtable.
 void executeProcedure(java.lang.String procedureName, Context aContext, Hashtable dataHashtable, java.lang.String aHashtableOutputFormatName)
          Executes the stored procedureName with the parameters given in the dataHashtable.
 void executeProcedure(java.lang.String procedureName, Context aContext, java.lang.String aHashtableInputFormatName)
          Instantiates the FormatElement defined as aHashtableInputFormatName and passes it as an argument to the method executeProcedure(String, Context, FormatElement).
 void executeProcedure(java.lang.String procedureName, Context aContext, java.lang.String aHashtableInputFormatName, java.lang.String aHashtableOutputFormatName)
          Instantiates the FormatElement defined as aHashtableInputFormatName and passes it as an argument to the executeProcedure(String, Context, FormatElement, String) method.
 void executeProcedure(java.lang.String procedureName, Hashtable dataHashtable)
          Executes the stored procedure procedureName with the parameters given in the dataHashtable
 Hashtable executeProcedureWithReply(java.lang.String procedureName, Hashtable dataHashtable)
           
 Vector executeSQLQuery(java.lang.String anSQLStatement)
          Executes an SQL statement that returns a single ResultSet and unformats it into aContext using the outputFormatName.
 void executeSQLQuery(java.lang.String anSQLStatement, java.lang.String outputFormatName, Context aContext)
          just implemnet , do nothing;
 int executeSQLUpdate(java.lang.String anSQLStatement)
          Executes an SQL INSERT, UPDATE ,DELETE statement, or an SQL statement that returns nothing.
 boolean getAutoConnect()
          Returns the autoConnect attribute value.
 java.lang.String getCatalogName()
          Returns the catalog attribute value.
 Hashtable getColumnsTable()
          Returns the columnsTable attribute value.
 java.lang.String getFullProcedureName(java.lang.String procedureName)
          Builds and returns the full name for the Stored Procedure, adding the schema name if it is set.
 java.lang.String getFullTableName()
          Builds and returns the full table name, adding the schema name if it is set.
 boolean getInUse()
          Returns the value of the inUse attribute.
protected  DatabaseResultSetMetaData getMetaData(java.lang.String aTableName)
          Returns a DatabaseResultSetMetaData instance with the table metadata information.
 java.lang.String getSchemaName()
          Returns the schema attribute value.
 java.lang.String getTableName()
          Returns the tableName attribute value.
 java.lang.Object handleCommand(java.lang.String opName, java.util.Hashtable parts)
          handleCommand just pass parameter to service, and let the service object execute operation
 void initialize()
          Performs any required actions after service instanciation and before starting using it.
 java.lang.Object initializeColumnFrom(Tag aTag)
          Used by the JDBCTable service externalizer to create the contents of the columnsTable instance attribute.
 java.lang.Object initializeFrom(Tag aTag)
          Used by the JDBCTable service externalizer to set the 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 isPrimaryKeys()
          Returns the primaryKeys attribute value.
 void reset()
          Resets the table.
 Vector retrieveRecordsMatching(java.lang.String aSearchCondition)
          Retrieves all the records within the database table that match the search condition.
 void retrieveRecordsMatching(java.lang.String aSearchCondition, Context aContext, FormatElement anOutputFormat)
          Retrieves all the records within the database table that match the search condition.
 void retrieveRecordsMatching(java.lang.String aSearchCondition, Context aContext, java.lang.String anOutputFormatName)
          Retrieves all the records within the database table that match the search condition.
 Vector retrieveRecordsMatching(java.lang.String aSearchCondition, Vector aColumnsVector)
          Retrieves the columns in aColumnsVector of all the records within the database table that match the search condition.
 void retrieveRecordsMatching(java.lang.String aSearchCondition, Vector aColumnsVector, Context aContext, FormatElement anOutputFormat)
          Retrieves the columns in aColumnsVector of all the records within the database table that match the search condition.
 void retrieveRecordsMatching(java.lang.String aSearchCondition, Vector aColumnsVector, Context aContext, java.lang.String anOutputFormatName)
          Retrieves the columns in aColumnsVector of all the records within the database table that match the search condition.
 void rollback()
          Rolls back all the database changes if the autoCommit attribute is set to false.
protected  Hashtable rowToRecord(java.sql.ResultSet aResultSet)
          Converts a row in the ResultSet, which is obtained after executing the SQL statement, to a data Hashtable.
 void setAutoConnect(boolean b)
          Sets the autoConnect attribute to a boolean.
 void setCatalogName(java.lang.String s)
          Sets the catalog attribute to the string provided as argument.
protected  void setColumnsTable(Hashtable h)
          Sets the columnsTable attribute to a Hashtable.
 void setInUse(boolean b)
          Sets the value of the inUse attribute.
 void setPrimaryKeys(boolean newPrimaryKeys)
          Sets the primaryKeys attribute value to newPrimaryKeys.
 void setSchemaName(java.lang.String s)
          Sets the schema attribute to the string provided as an argument.
 void setTableName(java.lang.String s)
          Sets the tableName attribute to the string provided as an argument.
 void setWaitRetry(boolean newWaitRetry)
          Sets the waitRetry attribute value to newWaitRetry.
 void terminate()
          Performs any required actions before the service instance can be stopped.
 Vector toStrings()
          Creates a visual representation of the object.
 int updateRecordsMatching(java.lang.String aSearchCondition, Context aContext, FormatElement aHashtableFormat)
          Updates all of the table records that match the search condition with the result from formatting the context data using the aHashtableFormat.
 int updateRecordsMatching(java.lang.String aSearchCondition, Context aContext, FormatElement aHashtableFormat, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector for the records that match the search condition with the data provided in the operation context.
 int updateRecordsMatching(java.lang.String aSearchCondition, Context aContext, java.lang.String aFormatName)
          Updates all the table records that match the search condition with the result from formatting the context data using the formatter defined as aFormatName.
 int updateRecordsMatching(java.lang.String aSearchCondition, Context aContext, java.lang.String aFormatName, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector for the records that match the search condition with the data provided in the operation context.
 int updateRecordsMatching(java.lang.String aSearchCondition, Hashtable aDataHashtable)
          Updates all the table records that match the search condition with the Hashtable data.
 int updateRecordsMatching(java.lang.String aSearchCondition, Hashtable aDataHashtable, Vector aColumnsVector)
          Updates the columns specified in aColumnsVector for all the records which match the search condition with the data provided in aDataHashtable.
 
Methods inherited from class com.ibm.btt.services.jdbcservicesinfra.JDBCServiceImpl
buildStatementArray, connect, getAddPstmt, getAddString, getAutoCommit, getConnectionManager, getConnectionProperties, getConnMgrID, getDatabaseConnection, getDataSourceName, getPassword, getUpdateString, getUser, isWaitRetry, requestConnectionToConnectionManager, requestConnectionToConnectionManager, resetOperationTime, setAddPstmt, setAddString, setAutoCommit, setConnectionManager, setConnectionProperties, setConnMgrID, setDatabaseConnection, setDatabaseURL, setDataSourceName, setPassword, setPoolName, setSharedConnection, setStatementPoolSize, setUpdateString, setUser, verifyConnection
 
Methods inherited from class com.ibm.btt.services.PoolableServiceImpl
getGrantTime, getUID, setGrantTime, setUID
 
Methods inherited from class com.ibm.btt.services.BTTServiceImpl
getInactiveTimeout, getLastAccess, processRequest, setInactiveTimeout, setLastAccess
 
Methods inherited from class com.ibm.btt.base.Service
externalizer, getExternalizer, getName, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, setName, toString, 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.jdbctableservice.TableService
getAutoCommit, getPassword, getUser, setAutoCommit, setPassword, setUser
 
Methods inherited from interface com.ibm.btt.services.jdbcservicesinfra.DatabaseConnect
getDataSourceName, isWaitRetry, setDataSourceName
 
Methods inherited from interface com.ibm.btt.services.Poolable
getGrantTime, getUID, setGrantTime, setUID
 

Field Detail

COMPID

public static final java.lang.String COMPID
Keeps the component identification that will be used by the traces tool.

See Also:
Constant Field Values

autoConnect

protected boolean autoConnect
Keeps the connection criteria that the JDBCTable service must follow. If it is set to true, the service will take care of managing the connection to the database.


tableName

protected java.lang.String tableName
The name of the table the JDBCTable service will work with.


schema

protected java.lang.String schema
The name of database schema where the table is created. It is used to get the database table primary keys.


primaryKeys

protected boolean primaryKeys
Keeps whether the service must prevent the application from modify a primary key when updating a record (the service will automatically remove any column set in the update statement that is a primary key for the table) or the application itself will take care of this issue and then the service will throw an exception if the application tries to update a primary key. The first one is the default behavior and requires the getPrimaryKeys() method to be implemented by the JDBC driver being used.


catalog

protected java.lang.String catalog
The name of database catalog where the table is created. It is used to get the database table primary keys.


columnsTable

protected Hashtable columnsTable
Contains information about the relationship between a column in the database table and a data field in the context. Has the following structure: key = column_name, value = data_field_name.


JDBCDriver

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


primaryKeysHashtable

protected Hashtable primaryKeysHashtable
Keeps the table primary keys for all the tables being accessed using a JDBCTable instance. The key is the full table name and the value is a Vector with the names of the table columns that are primary keys.


tablesMetaData

protected static Hashtable tablesMetaData
Keeps the table meta data information for all the tables being accessed using a JDBCTable instance. The key is the full table name and the value is an instance of the DatabaseResultSetMetaData class.

Constructor Detail

JDBCTableServiceImpl

public JDBCTableServiceImpl()
This constructor creates a JDBCTableService object.

Method Detail

addRecord

public void addRecord(Context aContext,
                      FormatElement aHashtableFormat)
               throws DSEInvalidArgumentException,
                      DSEInvalidRequestException,
                      DSEInternalErrorException,
                      DSESQLException,
                      DSEException,
                      DSEInvalidClassException,
                      java.lang.Exception
Calls the format method of the hashtable formatter aHashtableFormat by passing the aContext context as an argument. The returned object, a Hashtable instance, is then used to build the table record by calling the addRecord(Hashtable) method.

Specified by:
addRecord in interface TableService
Parameters:
aContext - Context
aHashtableFormat - HashtableFormat - the table formatter
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
DSEException - if an exception is thrown when calling the pool of connections
DSEInvalidClassException - if there is an error in the formatting process
java.lang.Exception

addRecord

public void addRecord(Context aContext,
                      FormatElement aHashtableFormat,
                      Vector aColumnsVector)
               throws DSEInvalidArgumentException,
                      DSEInvalidRequestException,
                      DSEInternalErrorException,
                      DSESQLException,
                      DSEException,
                      DSEInvalidClassException,
                      java.lang.Exception
Calls the format method of the hashtable formatter aHashtableFormat by passing the aContext context as an argument. The returned object, a Hashtable instance, is then used to build the table record by calling the addRecord(Hashtable, Vector) method. The aColumnsVector argument contains the columns that will be added for the new record in the database; the formatter definition must only contain the reference to these columns.

Specified by:
addRecord in interface TableService
Parameters:
aContext - Context
aHashtableFormat - FormatElement - the table formatter
aColumnsVector - Vector - the vector that contains the columns to be added
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEException - if an exception is thrown when calling the pool of connections
DSEInvalidClassException - if there is an error in the formatting process
java.lang.Exception

addRecord

public void addRecord(Context aContext,
                      java.lang.String aFormatName)
               throws DSEInvalidArgumentException,
                      DSEInvalidRequestException,
                      DSEInternalErrorException,
                      DSESQLException,
                      DSEException,
                      DSEInvalidClassException,
                      java.io.IOException,
                      java.lang.Exception
Instantiates the table format named aFormatName and calls its format method by passing the aContext as an argument. The returned object, a Hashtable instance, is then used to build the table record by calling the addRecord(Hashtable) method.

Specified by:
addRecord in interface TableService
Parameters:
aContext - Context
aFormatName - java.lang.String - the table formatter 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
DSEException - if an exception is thrown when calling the pool of connections
DSEInvalidClassException - if there is an error in the formatting process
java.io.IOException - if there is an error instanciating the formatter from its external definition
java.lang.Exception

addRecord

public void addRecord(Context aContext,
                      java.lang.String aFormatName,
                      Vector aColumnsVector)
               throws DSEInvalidArgumentException,
                      DSEInvalidRequestException,
                      DSEInternalErrorException,
                      DSESQLException,
                      DSEException,
                      DSEInvalidClassException,
                      java.io.IOException,
                      java.lang.Exception
Instantiates the table format named aFormatName and calls its format method by passing the aContext context as an argument. The returned object, a Hashtable instance, is then used to build the table record by calling the addRecord(Hashtable, Vector) method. The aColumnsVector argument contains the columns that will be added for the new record in the database; the formatter definition must only contain the reference to these columns.

Specified by:
addRecord in interface TableService
Parameters:
aContext - Context
aFormatName - java.lang.String - the table formatter name
aColumnsVector - Vector - the vector that contains the columns to be added
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEException - if an exception is thrown when calling the pool of connections
DSEInvalidClassException - if there is an error in the formatting process
java.io.IOException - if there is an error instanciating the formatter from its external definition
java.lang.Exception

handleCommand

public java.lang.Object handleCommand(java.lang.String opName,
                                      java.util.Hashtable parts)
                               throws java.lang.Exception
handleCommand just pass parameter to service, and let the service object execute operation

Overrides:
handleCommand in class JDBCServiceImpl
Throws:
java.lang.Exception

addRecord

public void addRecord(Hashtable aDataHashtable)
               throws DSEInvalidRequestException,
                      DSEInvalidArgumentException,
                      DSEInternalErrorException,
                      DSESQLException,
                      DSEException
Inserts the data from aDataHashtable as a new row into the table assigned to the table service. The data hashtable has the following format: key=data_field_name, value=data_field_value

Specified by:
addRecord in interface TableService
Parameters:
aDataHashtable - Hashtable
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
DSEException - if an exception is thrown when calling the pool of connections

addRecord

public void addRecord(Hashtable aDataHashtable,
                      Vector aColumnsVector)
               throws DSEInvalidArgumentException,
                      DSEInternalErrorException,
                      DSEInvalidRequestException,
                      DSESQLException,
                      DSEException
Inserts a record in the database only passing values to the columns specified in aColumnsVector. The aDataHashtable must contain only the data field values of the columns that have to be added to the database.

Specified by:
addRecord in interface TableService
Parameters:
aDataHashtable - Hashtable - the Hashtable that contains the data
aColumnsVector - Vector - the vector that contains the columns to be added
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
DSEException - if an exception is thrown when calling the pool of connections

buildAddString

public void buildAddString()
                    throws DSESQLException,
                           DSEInternalErrorException,
                           DSEInvalidRequestException,
                           DSEInvalidArgumentException,
                           DSEException
Builds an instance variable that is used when adding a records.

Specified by:
buildAddString in class JDBCServiceImpl
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSESQLException - if an SQLException is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections

buildAddString

public void buildAddString(Vector aColumnsVector)
                    throws DSESQLException,
                           DSEInternalErrorException,
                           DSEInvalidRequestException,
                           DSEInvalidArgumentException,
                           DSEException
Builds an instance variable that is used when adding a record with only specific columns values set by the application.

Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSESQLException - if an SQLException is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections

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 JDBCServiceImpl

buildUpdateString

public void buildUpdateString()
                       throws DSESQLException,
                              DSEInternalErrorException,
                              DSEInvalidRequestException,
                              DSEInvalidArgumentException,
                              DSEException
Builds an instance variable that is used when updating all columns of a record.

Specified by:
buildUpdateString in class JDBCServiceImpl
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSESQLException - if an SQLException is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections

commit

public void commit()
            throws DSESQLException
Commits all changes to the database. Nothing is done if the autoCommit attribute is set to true.

Specified by:
commit in interface TableService
Throws:
DSESQLException - if commit fails

connect

public void connect(java.lang.String aUser,
                    java.lang.String aPassword)
             throws DSEInternalErrorException,
                    DSEInvalidRequestException,
                    DSESQLException,
                    DSEObjectNotFoundException,
                    DSEException
Connects to the Database set in the DataSource definition using aUser and aPassword. This method can only be used if the connection is requested using a pool of connections implemented as a DataSource with the database URL specified as part of the DataSource definition.

Specified by:
connect in interface DatabaseConnect
Overrides:
connect in class JDBCServiceImpl
Parameters:
aUser - java.lang.String - the user identification
aPassword - java.lang.String - the user password
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEObjectNotFoundException - if the JDBCServicesConnectionManager cannot be found
DSEException - if an exception is thrown when calling the pool of connections manager

deleteRecordsMatching

public void deleteRecordsMatching(java.lang.String aSearchCondition)
                           throws DSEInvalidArgumentException,
                                  DSEInvalidRequestException,
                                  DSEInternalErrorException,
                                  DSESQLException,
                                  DSEException
Deletes the records in the table that match the search criteria.

Specified by:
deleteRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search criteria in SQL format
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEException - if an exception is thrown when calling the pool of connections

disconnect

public void disconnect()
                throws DSEInvalidRequestException,
                       DSESQLException,
                       DSEException
Closes the database connection.

Specified by:
disconnect in interface DatabaseConnect
Overrides:
disconnect in class JDBCServiceImpl
Throws:
DSESQLException - if a SQLException occurs
DSEException - if an exception is thrown when calling the pool of connections
DSEInvalidRequestException - if the database connection is null

executeProcedure

public void executeProcedure(java.lang.String procedureName,
                             Context aContext,
                             Hashtable dataHashtable,
                             FormatElement aHashtableOutputFormat)
                      throws DSEInvalidArgumentException,
                             DSEInvalidRequestException,
                             DSESQLException,
                             DSEInternalErrorException,
                             DSEException
Executes the stored procedure procedureName with the parameters given in the dataHashtable. The output parameters are unformatted with aHashtableOutputFormat into aContext.

Specified by:
executeProcedure in interface TableService
Parameters:
procedureName - java.lang.String
dataHashtable - Hashtable
aContext - Context
aHashtableOutputFormat - FormatElement
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections

executeProcedure

public void executeProcedure(java.lang.String procedureName,
                             Context aContext,
                             Hashtable dataHashtable,
                             java.lang.String aHashtableOutputFormatName)
                      throws DSEInvalidArgumentException,
                             DSEInvalidRequestException,
                             DSEInternalErrorException,
                             DSESQLException,
                             DSEException,
                             java.io.IOException
Executes the stored procedureName with the parameters given in the dataHashtable. The output parameters are unformatted with aHashtableFormatName into the aContext.

Specified by:
executeProcedure in interface TableService
Parameters:
procedureName - java.lang.String
dataHashtable - Hashtable
aContext - Context
aHashtableOutputFormatName - java.lang.String
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections
java.io.IOException - if there is an error instanciating the formatter from its external definition

executeProcedureWithReply

public Hashtable executeProcedureWithReply(java.lang.String procedureName,
                                           Hashtable dataHashtable)
                                    throws DSEInternalErrorException,
                                           DSESQLException,
                                           DSEInvalidArgumentException,
                                           DSEInvalidRequestException,
                                           DSEException,
                                           java.io.IOException
Specified by:
executeProcedureWithReply in interface TableService
Throws:
DSEInternalErrorException
DSESQLException
DSEInvalidArgumentException
DSEInvalidRequestException
DSEException
java.io.IOException

executeProcedure

public void executeProcedure(java.lang.String procedureName,
                             Context aContext,
                             FormatElement aHashtableInputFormat)
                      throws DSEInvalidArgumentException,
                             DSEInternalErrorException,
                             DSESQLException,
                             DSEInvalidRequestException,
                             DSEException
Builds a data Hashtable by calling the format method of the aHashtableInputFormat with the aContext as an argument. The returned Hashtable instance is then passed as parameter of the executeProcedure(String, Hashtable) method.

Specified by:
executeProcedure in interface TableService
Parameters:
procedureName - java.lang.String
aContext - Context
aHashtableInputFormat - FormatElement
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections

executeProcedure

public void executeProcedure(java.lang.String procedureName,
                             Context aContext,
                             FormatElement aHashtableInputFormat,
                             FormatElement aHashtableOutputFormat)
                      throws DSEInvalidArgumentException,
                             DSEInternalErrorException,
                             DSESQLException,
                             DSEInvalidRequestException,
                             DSEException
Builds a data Hashtable by calling the format method of the aHashtableFormat with the aContext as an argument. The returned Hashtable is then passed as a parameter of the executeProcedure(String, Context, Hashtable, FormatElement) method.

Specified by:
executeProcedure in interface TableService
Parameters:
procedureName - java.lang.String
aContext - Context
aHashtableInputFormat - FormatElement
aHashtableOutputFormat - FormatElement
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections

executeProcedure

public void executeProcedure(java.lang.String procedureName,
                             Context aContext,
                             FormatElement aHashtableInputFormat,
                             java.lang.String aHashtableOutputFormatName)
                      throws DSEInvalidArgumentException,
                             DSEInternalErrorException,
                             DSESQLException,
                             DSEInvalidRequestException,
                             DSEException,
                             java.io.IOException
Builds a data Hashtable by calling the format method of the aHashtableFormat with the aContext as an argument. The returned Hashtable is then passed as a parameter of the executeProcedure(String, Context, Hashtable, String) method.

Specified by:
executeProcedure in interface TableService
Parameters:
procedureName - java.lang.String
aContext - Context
aHashtableInputFormat - FormatElement
aHashtableOutputFormatName - java.lang.String
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections
java.io.IOException - if there is an error instanciating the formatter from its external definition

executeProcedure

public void executeProcedure(java.lang.String procedureName,
                             Context aContext,
                             java.lang.String aHashtableInputFormatName)
                      throws DSEInvalidArgumentException,
                             DSEInternalErrorException,
                             DSESQLException,
                             DSEInvalidRequestException,
                             DSEException,
                             java.io.IOException
Instantiates the FormatElement defined as aHashtableInputFormatName and passes it as an argument to the method executeProcedure(String, Context, FormatElement).

Specified by:
executeProcedure in interface TableService
Parameters:
procedureName - java.lang.String
aContext - Context
aHashtableInputFormatName - java.lang.String
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections
java.io.IOException - if there is an error instanciating the formatter from its external definition

executeProcedure

public void executeProcedure(java.lang.String procedureName,
                             Context aContext,
                             java.lang.String aHashtableInputFormatName,
                             java.lang.String aHashtableOutputFormatName)
                      throws DSEInvalidArgumentException,
                             DSEInternalErrorException,
                             DSESQLException,
                             DSEInvalidRequestException,
                             DSEException,
                             java.io.IOException
Instantiates the FormatElement defined as aHashtableInputFormatName and passes it as an argument to the executeProcedure(String, Context, FormatElement, String) method.

Specified by:
executeProcedure in interface TableService
Parameters:
procedureName - java.lang.String
aContext - Context
aHashtableInputFormatName - java.lang.String
aHashtableOutputFormatName - java.lang.String
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections
java.io.IOException - if there is an error instanciating the formatter from its external definition

executeProcedure

public void executeProcedure(java.lang.String procedureName,
                             Hashtable dataHashtable)
                      throws DSESQLException,
                             DSEInvalidRequestException,
                             DSEInternalErrorException,
                             DSEException
Executes the stored procedure procedureName with the parameters given in the dataHashtable

Specified by:
executeProcedure in interface TableService
Parameters:
procedureName - java.lang.String
dataHashtable - Hashtable
Throws:
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSEException - if an exception is thrown when calling the pool of connections

executeSQLQuery

public Vector executeSQLQuery(java.lang.String anSQLStatement)
                       throws DSESQLException,
                              DSEInvalidArgumentException,
                              DSEInvalidRequestException,
                              DSEInternalErrorException,
                              DSEException,
                              DSEObjectNotFoundException,
                              java.io.IOException
Executes an SQL statement that returns a single ResultSet and unformats it into aContext using the outputFormatName.

Parameters:
anSQLStatement - java.lang.String
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
DSEException - if an exception is thrown when calling the pool of connections
DSEObjectNotFoundException - if there is an error in the unformatting process
java.io.IOException - if there is an error instanciating the formatter from its external definition

executeSQLQuery

public void executeSQLQuery(java.lang.String anSQLStatement,
                            java.lang.String outputFormatName,
                            Context aContext)
                     throws DSEInternalErrorException,
                            DSESQLException,
                            DSEInvalidArgumentException,
                            DSEInvalidRequestException,
                            DSEException,
                            DSEObjectNotFoundException,
                            java.io.IOException
just implemnet , do nothing;

Specified by:
executeSQLQuery in interface TableService
Parameters:
anSQLStatement - java.lang.String
outputFormatName - java.lang.String
aContext - Context
Throws:
DSEInternalErrorException - if an internal program error occurs
DSEInvalidRequestException - if the request is not valid
java.io.IOException - if there is an error instanciating the formatter from its external definition
DSESQLException - if an SQLException is caught
DSEObjectNotFoundException - if there is an error in the unformatting process
DSEException - if an exception is thrown when calling the pool of connections manager
DSEInvalidArgumentException

executeSQLUpdate

public int executeSQLUpdate(java.lang.String anSQLStatement)
                     throws DSESQLException,
                            DSEInvalidArgumentException,
                            DSEInvalidRequestException,
                            DSEInternalErrorException,
                            DSEException
Executes an SQL INSERT, UPDATE ,DELETE statement, or an SQL statement that returns nothing. The method returns the row count for INSERT, UPDATE or DELETE or 0 for a SQL statement that returns nothing.

Specified by:
executeSQLUpdate in interface TableService
Parameters:
anSQLStatement - java.lang.String
Returns:
int
Throws:
DSEInvalidArgumentException - if the argument(s) is(are) not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections

getAutoConnect

public boolean getAutoConnect()
Returns the autoConnect attribute value.

Specified by:
getAutoConnect in interface TableService
Returns:
boolean

getCatalogName

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

Specified by:
getCatalogName in interface TableService
Returns:
java.lang.String

getColumnsTable

public Hashtable getColumnsTable()
Returns the columnsTable attribute value.

Returns:
Hashtable

getFullProcedureName

public java.lang.String getFullProcedureName(java.lang.String procedureName)
Builds and returns the full name for the Stored Procedure, adding the schema name if it is set.

Returns:
java.lang.String

getFullTableName

public java.lang.String getFullTableName()
Builds and returns the full table name, adding the schema name if it is set.

Specified by:
getFullTableName in interface TableService
Returns:
java.lang.String

getInUse

public boolean getInUse()
Returns the value of the inUse attribute.

Specified by:
getInUse in interface Poolable
Overrides:
getInUse in class PoolableServiceImpl
Returns:
boolean - The value of the inUse attribute
See Also:
Poolable.getInUse()

getMetaData

protected DatabaseResultSetMetaData getMetaData(java.lang.String aTableName)
                                         throws DSEInternalErrorException,
                                                DSESQLException,
                                                DSEInvalidArgumentException,
                                                DSEInvalidRequestException,
                                                DSEException
Returns a DatabaseResultSetMetaData instance with the table metadata information. This method always gets this information from the database.

Parameters:
aTableName - java.lang.String - the table name
Returns:
DatabaseResultSetMetaData
Throws:
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQL Exception is caught
DSEInvalidArgumentException - if the argument is empty or null
DSEInvalidRequestException - if the request is not valid
DSEException - if an exception is thrown when calling the pool of connections

getSchemaName

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

Specified by:
getSchemaName in interface TableService
Returns:
java.lang.String

getTableName

public java.lang.String getTableName()
Returns the tableName attribute value.

Specified by:
getTableName in interface TableService
Returns:
java.lang.String

initialize

public void initialize()
                throws DSEException
Performs any required actions after service instanciation and before starting using it.

Specified by:
initialize in interface Poolable
Overrides:
initialize in class PoolableServiceImpl
Throws:
DSEException
See Also:
Poolable.initialize()

initializeColumnFrom

public java.lang.Object initializeColumnFrom(Tag aTag)
Used by the JDBCTable service externalizer to create the contents of the columnsTable instance attribute. The columnsTable is a Hashtable with a key that is equal to the column name and a value that is equal to the data field name in the context.

Parameters:
aTag - Tag
Returns:
java.lang.Object

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Used by the JDBCTable service externalizer to set the instance attributes as defined in the XML file.

Specified by:
initializeFrom in interface Externalizable
Overrides:
initializeFrom in class BTTServiceImpl
Parameters:
aTag - Tag
Returns:
java.lang.Object
Throws:
java.io.IOException - if an I/O Exception has occurred
DSEException

isConnected

public boolean isConnected()
                    throws DSEInvalidRequestException,
                           DSEInternalErrorException,
                           DSESQLException,
                           DSEException
Returns true if there is a connection to the database or false if there is not. If the autoConnect attribute has been set to true and the connection to the database does not already exist, it creates its own connection.

Specified by:
isConnected in interface DatabaseConnect
Overrides:
isConnected in class JDBCServiceImpl
Returns:
boolean
Throws:
DSEInvalidRequestException - if the request is not valid
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException is caught
DSEException - if an exception is thrown when calling the pool of connections

isPrimaryKeys

public boolean isPrimaryKeys()
Returns the primaryKeys attribute value.

Specified by:
isPrimaryKeys in interface TableService
Returns:
boolean

reset

public void reset()
           throws DSEException
Resets the table. This method is invoked when releasing the Poolable object

Specified by:
reset in interface Poolable
Overrides:
reset in class PoolableServiceImpl
Throws:
DSEException
See Also:
Poolable.reset()

retrieveRecordsMatching

public Vector retrieveRecordsMatching(java.lang.String aSearchCondition)
                               throws DSEInternalErrorException,
                                      DSEInvalidRequestException,
                                      DSEInvalidArgumentException,
                                      DSESQLException,
                                      DSEException
Retrieves all the records within the database table that match the search condition.

Specified by:
retrieveRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search condition in SQL format
Returns:
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
DSEException - if an exception is thrown when calling the pool of connections

retrieveRecordsMatching

public void retrieveRecordsMatching(java.lang.String aSearchCondition,
                                    Context aContext,
                                    FormatElement anOutputFormat)
                             throws DSEInternalErrorException,
                                    DSEInvalidRequestException,
                                    DSEInvalidArgumentException,
                                    DSESQLException,
                                    DSEException,
                                    java.io.IOException
Retrieves all the records within the database table that match the search condition. The retrieved records are then unformatted into the aContext using anOutputFormat.

Specified by:
retrieveRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search condition in SQL format
aContext - Context - the context to where the retrieved records will be unformatted
anOutputFormat - 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
DSEException - if an exception is thrown when calling the pool of connections
java.io.IOException - if there is an error instanciating the formatter from its external definition

retrieveRecordsMatching

public void retrieveRecordsMatching(java.lang.String aSearchCondition,
                                    Context aContext,
                                    java.lang.String anOutputFormatName)
                             throws DSEInternalErrorException,
                                    DSEInvalidRequestException,
                                    DSEInvalidArgumentException,
                                    DSESQLException,
                                    DSEException,
                                    java.io.IOException
Retrieves all the records within the database table that match the search condition. The retrieved records are then unformatted into the aContext using the format named anOutputFormatName.

Specified by:
retrieveRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search condition in SQL format
aContext - Context - the context into which 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 SQL Exception is caught
DSEException - if an exception is thrown when calling the pool of connections
java.io.IOException - if there is an error instanciating the formatter from its external definition

retrieveRecordsMatching

public Vector retrieveRecordsMatching(java.lang.String aSearchCondition,
                                      Vector aColumnsVector)
                               throws DSEInternalErrorException,
                                      DSEInvalidRequestException,
                                      DSEInvalidArgumentException,
                                      DSESQLException,
                                      DSEException
Retrieves the columns in aColumnsVector of all the records within the database table that match the search condition. The format used to put the retrieved data into the operation context must only unformat the returned column values.

Specified by:
retrieveRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search condition in SQL format
aColumnsVector - Vector - the vector that contains the columns to be retrieved
Returns:
Vector - the vector of Hashtables 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
DSEException - if an exception is thrown when calling the pool of connections

retrieveRecordsMatching

public void retrieveRecordsMatching(java.lang.String aSearchCondition,
                                    Vector aColumnsVector,
                                    Context aContext,
                                    FormatElement anOutputFormat)
                             throws DSEInternalErrorException,
                                    DSEInvalidRequestException,
                                    DSEInvalidArgumentException,
                                    DSESQLException,
                                    DSEException
Retrieves the columns in aColumnsVector of all the records within the database table that match the search condition. The retrieved records are then unformatted into the aContext using anOutputFormat.

Specified by:
retrieveRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search condition in SQL format
aColumnsVector - Vector - the vector that contains the columns to be retrieved
aContext - Context - the context into which the retrieved records will be unformatted
anOutputFormat - 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
DSEException - if an exception is thrown when calling the pool of connections

retrieveRecordsMatching

public void retrieveRecordsMatching(java.lang.String aSearchCondition,
                                    Vector aColumnsVector,
                                    Context aContext,
                                    java.lang.String anOutputFormatName)
                             throws DSEInternalErrorException,
                                    DSEInvalidRequestException,
                                    DSEInvalidArgumentException,
                                    DSESQLException,
                                    DSEException,
                                    java.io.IOException
Retrieves the columns in aColumnsVector of all the records within the database table that match the search condition. The retrieved records are then unformatted into the aContext using the format named anOutputFormatName.

Specified by:
retrieveRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search condition in SQL format
aColumnsVector - Vector - the vector that contains the columns to be retrieved
aContext - Context - the context into which 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
DSEException - if an exception is thrown when calling the pool of connections
java.io.IOException - if there is an error instanciating the formatter from its external definition

rollback

public void rollback()
              throws DSESQLException
Rolls back all the database changes if the autoCommit attribute is set to false.

Specified by:
rollback in interface TableService
Throws:
DSESQLException - when rollback fails

rowToRecord

protected Hashtable rowToRecord(java.sql.ResultSet aResultSet)
                         throws DSEInvalidArgumentException,
                                DSEInternalErrorException,
                                DSESQLException
Converts a row in the ResultSet, which is obtained after executing the SQL statement, to a data Hashtable.

Parameters:
aResultSet - ResultSet - the retrieved row as a ResultSet
Returns:
Hashtable - the retrieved row as a Hashtable
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an other problem occurs

setAutoConnect

public void setAutoConnect(boolean b)
Sets the autoConnect attribute to a boolean.

Specified by:
setAutoConnect in interface TableService
Parameters:
b - boolean

setCatalogName

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

Specified by:
setCatalogName in interface TableService
Parameters:
s - java.lang.String

setColumnsTable

protected void setColumnsTable(Hashtable h)
Sets the columnsTable attribute to a Hashtable.

Parameters:
h - Hashtable

setInUse

public void setInUse(boolean b)
Sets the value of the inUse attribute.

Specified by:
setInUse in interface Poolable
Overrides:
setInUse in class PoolableServiceImpl
Parameters:
b - - The new value of the inUse attribute
See Also:
Poolable.setInUse(boolean)

setPrimaryKeys

public void setPrimaryKeys(boolean newPrimaryKeys)
Sets the primaryKeys attribute value to newPrimaryKeys.

Specified by:
setPrimaryKeys in interface TableService
Parameters:
newPrimaryKeys - boolean

setSchemaName

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

Specified by:
setSchemaName in interface TableService
Parameters:
s - java.lang.String

setTableName

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

Specified by:
setTableName in interface TableService
Parameters:
s - java.lang.String

setWaitRetry

public void setWaitRetry(boolean newWaitRetry)
Sets the waitRetry attribute value to newWaitRetry.

Specified by:
setWaitRetry in interface DatabaseConnect
Overrides:
setWaitRetry in class JDBCServiceImpl
Parameters:
newWaitRetry - boolean

terminate

public void terminate()
               throws DSEException
Performs any required actions before the service instance can be stopped.

Specified by:
terminate in interface Poolable
Overrides:
terminate in class PoolableServiceImpl
Throws:
DSEException

toStrings

public Vector toStrings()
Creates a visual representation of the object. This is used by the externalizer.

Specified by:
toStrings in interface Externalizable
Overrides:
toStrings in class Service
Returns:
Vector

updateRecordsMatching

public int updateRecordsMatching(java.lang.String aSearchCondition,
                                 Context aContext,
                                 FormatElement aHashtableFormat)
                          throws DSEInvalidRequestException,
                                 DSEInvalidArgumentException,
                                 DSESQLException,
                                 DSEException
Updates all of the table records that match the search condition with the result from formatting the context data using the aHashtableFormat.

Specified by:
updateRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String
aContext - Context
aHashtableFormat - FormatElement
Returns:
int - the number of updated records
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEException - if an exception is thrown when calling the pool of connections
DSESQLException - if an SQLException is caught

updateRecordsMatching

public int updateRecordsMatching(java.lang.String aSearchCondition,
                                 Context aContext,
                                 FormatElement aHashtableFormat,
                                 Vector aColumnsVector)
                          throws DSEInvalidRequestException,
                                 DSEInvalidArgumentException,
                                 DSESQLException,
                                 DSEException
Updates the columns specified in aColumnsVector for the records that match the search condition with the data provided in the operation context. The aHashtableFormat must only format the new data values.

Specified by:
updateRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String
aContext - Context
aHashtableFormat - FormatElement
aColumnsVector - Vector the vector that contains the columns to be updated
Returns:
int - the number of updated records
Throws:
DSEInvalidArgumentException - if an argument is not valid
DSEInvalidRequestException - if the input parameters are not valid
DSEException - if an exception is thrown when calling the pool of connections
DSESQLException - if an SQLException is caught

updateRecordsMatching

public int updateRecordsMatching(java.lang.String aSearchCondition,
                                 Context aContext,
                                 java.lang.String aFormatName)
                          throws DSEInvalidRequestException,
                                 DSEInternalErrorException,
                                 DSEInvalidArgumentException,
                                 DSESQLException,
                                 DSEInvalidClassException,
                                 DSEException,
                                 java.io.IOException
Updates all the table records that match the search condition with the result from formatting the context data using the formatter defined as aFormatName.

Specified by:
updateRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search condition
aContext - Context - the context containing the new data values
aFormatName - java.lang.String - the name of the formatter that needs to be instantiated to format the data that is in the context
Returns:
int - the 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
DSEException - if an exception is thrown when calling the pool of connections
DSEInvalidClassException - if there is an error in the formatting process
java.io.IOException - if there is an error instanciating the formatter from its external definition

updateRecordsMatching

public int updateRecordsMatching(java.lang.String aSearchCondition,
                                 Context aContext,
                                 java.lang.String aFormatName,
                                 Vector aColumnsVector)
                          throws DSEInvalidArgumentException,
                                 DSEInternalErrorException,
                                 DSEInvalidRequestException,
                                 DSESQLException,
                                 DSEInvalidClassException,
                                 DSEException,
                                 java.io.IOException
Updates the columns specified in aColumnsVector for the records that match the search condition with the data provided in the operation context. The format identified by aHashtableFormatName must only format the new data values.

Specified by:
updateRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String
aContext - Context - the context containing the new data values
aFormatName - java.lang.String - the name of the format that needs to be instantiated to format the data that is in the context
aColumnsVector - Vector - the vector that contains the columns to be updated
Returns:
int - the 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
DSEException - if an exception is thrown when calling the pool of connections
DSEInvalidClassException - if there is an error in the formatting process
java.io.IOException - if there is an error instanciating the formatter from its external definition

updateRecordsMatching

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

Specified by:
updateRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String - the search condition
aDataHashtable - Hashtable - the Hashtable that contains the new data
Returns:
int - the 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 - is an SQLException is caught
DSEException - if an exception is thrown when calling the pool of connections

updateRecordsMatching

public int updateRecordsMatching(java.lang.String aSearchCondition,
                                 Hashtable aDataHashtable,
                                 Vector aColumnsVector)
                          throws DSEInvalidArgumentException,
                                 DSEInternalErrorException,
                                 DSEInvalidRequestException,
                                 DSESQLException,
                                 DSEException
Updates the columns specified in aColumnsVector for all the records which match the search condition with the data provided in aDataHashtable. The aDataHashtable must contain only the data field values of the columns that have to be updated in the database.

Specified by:
updateRecordsMatching in interface TableService
Parameters:
aSearchCondition - java.lang.String
aDataHashtable - Hashtable - the Hashtable that contains the new data
aColumnsVector - Vector - the vector that contains the columns to be changed
Returns:
int - the 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
DSEException - if an exception is thrown when calling the pool of connections

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005