com.ibm.dse.services.appltables
Class ApplicationTables

java.lang.Object
  |
  +--com.ibm.dse.base.DSENotifier
        |
        +--com.ibm.dse.base.Service
              |
              +--com.ibm.dse.services.appltables.ApplicationTables

public class ApplicationTables
extends Service
implements ApplicationTablesService, ApplicationTablesMemoryCreation, ApplicationTablesLoad

The Application Tables Service provides a way to access static table data from an application. It provides a specific implementation of the following interfaces:

    The ApplicationTablesService interface, that has been implemented using the JDBC interface. This implementation can then be used with any database management system providing JDBC connectivity.

    The ApplicationTablesLoad interface, that read a table definition from an XML file. The way that this XML file is generated from the permanent database storage system is left to the application (various tools can be found to run this export/import process).

    The ApplicationTablesMemoryCreation interface, to build the data table into system memory by using a JDBC interface both to create the table and add the table records.

See Also:
Serialized Form

Field Summary
protected  boolean changesControl
          A boolean value to control static table changes every time a request is done.
protected  java.lang.String classNameForTableAccess
          Name of the class to be instantiated and used to access the static tables information.
protected  java.lang.String classNameForTableLoad
          Name of the class to be instantiated and used to read the static tables information and load them into memory.
protected  java.lang.String classNameForTableMemoryCreation
          Name of the class to be instantiated and used to create static tables into memory.
static java.lang.String COMPID
          Keeps the component identification that will be used by the traces tool.
protected  java.lang.String databaseInMemoryURL
          The database URL where the table is created.
protected  java.lang.String enterprise
          The enterprise attribute to be used to get a static table data.
protected  java.lang.String externalJDBCDriver
          Name of the JDBC Driver that the service will use to request the connection to the permanent data storage for reading the tables information and loading them into memory.
protected  java.lang.String externalPassword
          The password used to logon to the permanent data storage, if required.
protected  java.lang.String externalSourceURL
          Location of the data source that contains the tables definition.
protected  java.lang.String externalUserid
          The userID used to logon to the permanent data storage, if required.
protected  java.lang.String filter
          Keeps the search condition to be applied when getting the records from the table.
protected  java.sql.Connection inMemoryConnection
          The password used to logon to the database, if required.
protected  java.lang.String inMemoryJDBCDriver
          Name of the JDBC Driver that the service will use to request the connection to the database or to execute the SQL statements.
protected  java.lang.String inMemoryPassword
          The password used to logon to the database, if required.
protected  java.lang.String inMemoryUserid
          The userID used to logon to the database, if it is required.
protected  java.lang.String language
          The language attribute to be used to get a static table data.
protected  boolean loadAllTables
          When set to true, all tables will be loaded into memory when the Application Tables service is initialized.
protected  boolean loadAllTablesFromServer
          Flag indicating that the loading of all tables form a remote location is pending.
protected  java.lang.String order
          Keeps the column name by which the table records will be ordered when executing next query.
protected  boolean searchRemotelly
          When set to true, if the requested table data is not locally available, an operation will be started to get the information from the server.
protected  long timeout
          Keeps the timeout for the ApplicationTablesServerOp execution.
 
Fields inherited from class com.ibm.dse.base.Service
externalizer
 
Fields inherited from class com.ibm.dse.base.DSENotifier
handlersList, name
 
Constructor Summary
ApplicationTables()
          This constructor creates an instance of ApplicationTables.
ApplicationTables(java.lang.String aName)
          This constructor creates an instance of ApplicationTables and sets its name attribute to aName.
 
Method Summary
 void addRecord(java.lang.String aTableName, Vector vectorOfColumnsValues)
          Inserts in memory a new row in the table aTableName with the values set in the vectorOfColumnsValues vector.
 void addRecord(java.lang.String aTableName, Vector vectorOfColumns, Vector vectorOfColumnsValues)
          Inserts a new row in a table that is in memory.
protected  IndexedCollection allRowsToIColl(java.sql.ResultSet aResultSet, java.lang.String aTableName)
          Converts all rows in the ResultSet obtained after executing a retrieve SQL statement to a indexed collection of keyed collections.
protected  Vector allRowsToRecords(java.sql.ResultSet aResultSet, java.lang.String aTableName)
          Converts all rows in the ResultSet obtained after executing a retrieve SQL statement to a vector of hashtables.
 boolean checkForTableInDatabase(java.lang.String aTableName)
          Returns true if the table exists in memory or false if it does not.
 void connect(java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword)
          Establishes a database connection
 void createTable(java.lang.String tableName)
          Creates an empty table in memory.
 void createTable(java.lang.String tableName, Vector vectorOfColumns)
          Creates an empty table in memory with columns as specified in vectorOfColumns.
 void disconnect()
          Closes the connection to the database.
 void dropTable(java.lang.String aTableName)
          Deletes from memory the table aTableName.
protected  boolean existTable(java.lang.String aTableName)
          Checks for the table existence either in memory or in the external data storage.
protected  boolean existTable(java.lang.String aTableName, java.lang.String language, java.lang.String enterprise)
          Checks for the table existence either in memory or in the external data storage.
 Vector getAllRecords(java.lang.String aTableName)
          Gets all columns of all the records in the table specified by aTableName.
 void getAllRecords(java.lang.String aTableName, HashtableIndexedCollectionFormat aHashtableICollFormat, Context aContext)
          Gets all columns of all records in table aTableName.
 void getAllRecords(java.lang.String aTableName, HashtableIndexedCollectionFormat aHashtableICollFormat, Context aContext, Vector vectorOfColumns)
          Gets all columns of all records in table aTableName.
 void getAllRecords(java.lang.String aTableName, java.lang.String aHashtableICollFormatName, Context aContext)
          Gets all columns of all records in table aTableName.
 void getAllRecords(java.lang.String aTableName, java.lang.String aHashtableICollFormatName, Context aContext, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of all records in table aTableName.
 Vector getAllRecords(java.lang.String aTableName, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of all the records in table specified by aTableName.
protected  ApplicationTablesService getClassForTableAccess()
          Returns an instance of the class that implements the ApplicationTablesService interface.
protected  ApplicationTablesLoad getClassForTableLoad()
          Returns an instance of the class that implements the ApplicationTablesLoad interface.
protected  ApplicationTablesMemoryCreation getClassForTableMemoryCreation()
          Returns an instance of the class that implements the ApplicationTablesMemoryCreation interface.
protected  java.lang.String getClassNameForTableAccess()
          Returns the classNameForTableAccess attribute value.
protected  java.lang.String getClassNameForTableLoad()
          Returns the classNameForTableLoad attribute value.
protected  java.lang.String getClassNameForTableMemoryCreation()
          Returns the classNameForTableMemoryCreation attribute value.
 Vector getColumnsNames(java.lang.String aTableName)
          Returns a Vector holding the names of the columns in the table.
protected  java.lang.String getDatabaseInMemoryURL()
          Returns the databaseInMemoryURL attribute value.
 java.lang.String getEnterprise()
          Returns the enterprise attribute value.
protected  java.lang.String getExternalJDBCDriver()
          Returns the externalJDBCDriver attribute value.
protected  java.lang.String getExternalPassword()
          Returns the externalPassword attribute value.
protected  java.lang.String getExternalSourceURL()
          Returns the externalSourceURL attribute value.
protected  java.lang.String getExternalUserid()
          Returns the externalUserid attribute value.
protected  java.lang.String getFilter()
          Returns the filter attribute value.
 java.sql.Connection getInMemoryConnection()
          Returns the inMemoryConnection attribute value.
protected  java.lang.String getInMemoryJDBCDriver()
          Returns the inMemoryJDBCDriver attribute value.
protected  java.lang.String getInMemoryPassword()
          Returns the inMemoryPassword attribute value.
protected  java.lang.String getInMemoryUserid()
          Returns the inMemoryUserid attribute value.
 java.lang.String getLanguage()
          Returns the language attribute value.
 Vector getNextRecords(java.lang.String aTableName, int cursorPosition, int numberOfRecords)
          Gets all columns of the next numberOfRecords records from the position set as cursorPosition in table aTableName.
 int getNextRecords(java.lang.String aTableName, int cursorPosition, int numberOfRecords, HashtableIndexedCollectionFormat aHashtableICollFormat, Context aContext)
          Gets all columns of the next numberOfRecords records from the cursor position set as cursorPosition in table aTableName.
 int getNextRecords(java.lang.String aTableName, int cursorPosition, int numberOfRecords, HashtableIndexedCollectionFormat aHashtableICollFormat, Context aContext, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the next numberOfRecords records from the cursor position set as cursorPosition in table aTableName.
 int getNextRecords(java.lang.String aTableName, int cursorPosition, int numberOfRecords, java.lang.String aHashtableICollFormatName, Context aContext)
          Gets all columns of the next numberOfRecords records from the cursor position set as cursorPosition in table aTableName.
 int getNextRecords(java.lang.String aTableName, int cursorPosition, int numberOfRecords, java.lang.String aHashtableICollFormatName, Context aContext, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the next numberOfRecords records from the cursor position set as cursorPosition in table aTableName.
 Vector getNextRecords(java.lang.String aTableName, int cursorPosition, int numberOfRecords, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the next numberOfRecords records from the position set as cursorPosition in table aTableName.
protected  java.lang.String getOrder()
          Returns the order attribute value.
 java.lang.String getPrimaryKey(java.lang.String aTableName)
          Returns the name of the table aTableName column that is primary key.
 Hashtable getRecord(java.lang.String aTableName, java.lang.Object key)
          Gets all columns of the record identified by a key from the table aTableName.
 void getRecord(java.lang.String aTableName, java.lang.Object key, HashtableFormat aHashtableFormat, Context aContext)
          Gets all columns of the record identified by a key from the table aTableName.
 void getRecord(java.lang.String aTableName, java.lang.Object key, HashtableFormat aHashtableFormat, Context aContext, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the record identified by key from the table aTableName.
 void getRecord(java.lang.String aTableName, java.lang.Object key, java.lang.String aHashtableFormatName, Context aContext)
          Gets all columns of the record identified by key from the table aTableName.
 void getRecord(java.lang.String aTableName, java.lang.Object key, java.lang.String aHashtableFormatName, Context aContext, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the record identified by key from the table aTableName.
 Hashtable getRecord(java.lang.String aTableName, java.lang.Object key, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the record identified by a key from the table aTableName.
 Vector getRecords(java.lang.String aTableName, java.lang.Object keyFrom, java.lang.Object keyTo)
          Gets all columns of the records with primary key between keyFrom and keyTo values from the table aTableName.
 void getRecords(java.lang.String aTableName, java.lang.Object keyFrom, java.lang.Object keyTo, HashtableIndexedCollectionFormat aHashtableICollFormat, Context aContext)
          Gets all columns of the records with primary key between keyFrom and keyTo from the table aTableName.
 void getRecords(java.lang.String aTableName, java.lang.Object keyFrom, java.lang.Object keyTo, HashtableIndexedCollectionFormat aHashtableICollFormat, Context aContext, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the records with primary key between keyFrom and keyTo from the table aTableName.
 void getRecords(java.lang.String aTableName, java.lang.Object keyFrom, java.lang.Object keyTo, java.lang.String aHashtableICollFormatName, Context aContext)
          Gets all columns of the records with primary key between keyFrom and keyTo from the table aTableName.
 void getRecords(java.lang.String aTableName, java.lang.Object keyFrom, java.lang.Object keyTo, java.lang.String aHashtableICollFormatName, Context aContext, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the records with primary key between keyFrom and keyTo from the table aTableName.
 Vector getRecords(java.lang.String aTableName, java.lang.Object keyFrom, java.lang.Object keyTo, Vector vectorOfColumns)
          Gets the columns specified in vectorOfColumns argument of the records with primary key between keyFrom and keyTo from the table aTableName.
 Vector getTableNames()
          Returns a Vector with the name of all tables created in the memory database.
 java.lang.Object getTableRecords(java.lang.String aTableName, java.lang.String stOrder, java.lang.String stFilter)
          Returns an Object containing all the records in the table aTable name matching the stFilter search condition and ordered as set in the stOrder argument.
 java.lang.Object getTableRecords(java.lang.String aTableName, java.lang.String stOrder, java.lang.String stFilter, Vector vectorOfColumns)
          Returns an Object containing all records in the table aTable name matching the stFilter search condition and ordered as set in the stOrder argument.
protected  Hashtable getTablesCatalog()
          Returns the tables catalog.
protected  long getTimeout()
          Returns the timeout attribute value.
 java.lang.Object initializeFrom(Tag aTag)
          Used by the ApplicationTables service externalizer to set the instance attributes as defined in the XML file.
 java.lang.Object initializeTableFrom(Tag aTag)
          Used by the ApplicationTables service externalizer to create the tables catalog from its external definition.
protected  boolean isChangesControl()
          Returns the changesControl attribute value.
protected  boolean isLoadAllTables()
          Returns the loadAllTables attribute value.
protected  boolean isSearchRemotelly()
          Returns the searchRemotelly attribute value.
 void loadTableFromExternalSource()
          Reads the table and its contents from an external data storage and calls the ApplicationTablesMemoryCreation methods to create the table in memory.
 void loadTableFromExternalSource(java.lang.String language, java.lang.String enterprise)
          Reads the table and its contents from an external data storage and calls the ApplicationTablesMemoryCreation methods to create the table in memory.
 boolean loadTableFromExternalSource(java.lang.String aTableName, java.lang.String version, java.lang.String release, java.lang.String language, java.lang.String enterprise)
          Reads the table aTableName and its contents from an external data storage and calls the ApplicationTablesMemoryCreation methods to create the table in memory.
 Hashtable manageRecord(java.lang.String aTableName, java.lang.Object records)
          Returns a Hashtable containing the data of the record retrieved by executing the getTableRecords() method.
 Vector manageRecords(java.lang.String aTableName, int cursorPosition, int numberOfRecords, java.lang.Object records)
          Returns a Vector of Hashtables.
 Vector manageRecords(java.lang.String aTableName, java.lang.Object records)
          Returns a Vector of Hashtables.
protected  java.sql.ResultSet selectTable(java.lang.String stTable, Vector vColumns, Vector vValues, java.lang.String stOrder, java.lang.String stFilter)
          Executes a database query to get the requested records from the table.
protected  void setChangesControl(boolean newChangesControl)
          Sets the changesControl attribute value to newChangesControl.
protected  void setClassNameForTableAccess(java.lang.String newClassNameForTableAccess)
          Sets the classNameForTableAccess attribute value to newClassNameForTableAccess.
protected  void setClassNameForTableLoad(java.lang.String newClassNameForTableLoad)
          Sets the classNameForTableLoad attribute value to newClassNameForTableLoad.
protected  void setClassNameForTableMemoryCreation(java.lang.String newClassNameForTableMemoryCreation)
          Sets the classNameForTableMemoryCreation attribute value to newClassForTableMemoryCreation.
protected  void setDatabaseInMemoryURL(java.lang.String newDatabaseURL)
          Sets the databaseInMemoryURL attribute value to newDatabaseURL.
protected  void setEnterprise(java.lang.String newEnterprise)
          Sets the enterprise attribute value to newEnterprise.
protected  void setExternalJDBCDriver(java.lang.String newJDBCDriver)
          Sets the externalJDBCDriver attribute value to newJDBCDriver.
protected  void setExternalPassword(java.lang.String newExternalPassword)
          Sets the externalPassword attribute value to newExternalPassword.
protected  void setExternalSourceURL(java.lang.String newExternalSourceURL)
          Sets the externalSourceURL attribute value to newExternalSourceURL.
protected  void setExternalUserid(java.lang.String newExternalUserid)
          Sets the externalUserid attribute value to newExternalUserid.
 void setFilter(java.lang.String newFilter)
          Sets the filter attribute value to newFilter.
protected  void setInMemoryJDBCDriver(java.lang.String newJDBCDriver)
          Sets the inMemoryJDBCDriver attribute value to newJDBCDriver.
protected  void setInMemoryPassword(java.lang.String newPassword)
          Sets the inMemoryPassword attribute value to newPassword.
protected  void setInMemoryUserid(java.lang.String newUserid)
          Sets the inMemoryUserid attribute value to newUserid.
protected  void setLanguage(java.lang.String newLanguage)
          Sets the language attribute value to newLanguage.
protected  void setLoadAllTables(boolean newLoadAllTables)
          Sets the loadAllTables attribute value to newLoadAllTables.
 void setOrder(java.lang.String newOrder)
          Sets the order attribute value to newOrder.
protected  void setSearchRemotelly(boolean newSearchRemotelly)
          Sets the searchRemotelly attribute value to newSearchRemotelly.
protected  void setTimeout(long newTimeout)
          Sets the timeout attribute value to newTimeout.
 void terminate()
          Contains all needed code to be executed when the service is no more being used.
 Vector toStrings()
          Used by the ApplicationTables service externalizer.
protected  void updateAllTablesInMemory(IndexedCollection allTables)
          This method is call when getting the reply from the server after the ApplicationTablesClientOp operation execution with table name "allTables".
protected  void updateTablesInMemory(IndexedCollection responseData)
          This method is call when getting the reply from the server after the ApplicationTablesClientOp operation execution.
 
Methods inherited from class com.ibm.dse.base.Service
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, 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

databaseInMemoryURL

protected java.lang.String databaseInMemoryURL
The database URL where the table is created. Used to establish a connection to the data storage system that is used to access the table data.

inMemoryUserid

protected java.lang.String inMemoryUserid
The userID used to logon to the database, if it is required. Used to establish a connection to the data storage system that is used to access the table data.

inMemoryPassword

protected java.lang.String inMemoryPassword
The password used to logon to the database, if required. Used to establish a connection to the data storage system that is used to access the table data.

inMemoryJDBCDriver

protected java.lang.String inMemoryJDBCDriver
Name of the JDBC Driver that the service will use to request the connection to the database or to execute the SQL statements. Only needed if a JDBC interface will be used to access the tables.

changesControl

protected boolean changesControl
A boolean value to control static table changes every time a request is done. Default value is false.

externalSourceURL

protected java.lang.String externalSourceURL
Location of the data source that contains the tables definition. In the default implementation, this is the path and the name of the XML file. It is only used to load the table information into memory.

externalUserid

protected java.lang.String externalUserid
The userID used to logon to the permanent data storage, if required. Used to establish a connection to the data storage system that is used to read the tables information and load them into memory.

externalPassword

protected java.lang.String externalPassword
The password used to logon to the permanent data storage, if required. Used to establish a connection to the data storage system that is used to read the tables information and load them into memory.

externalJDBCDriver

protected java.lang.String externalJDBCDriver
Name of the JDBC Driver that the service will use to request the connection to the permanent data storage for reading the tables information and loading them into memory. Only needed if a JDBC interface will be used to access the tables.

inMemoryConnection

protected java.sql.Connection inMemoryConnection
The password used to logon to the database, if required. Used to establish a connection to the data storage system that is used to access the table data.

COMPID

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

loadAllTables

protected boolean loadAllTables
When set to true, all tables will be loaded into memory when the Application Tables service is initialized. Default value is false.

searchRemotelly

protected boolean searchRemotelly
When set to true, if the requested table data is not locally available, an operation will be started to get the information from the server. Both client and server operation definitions must be added in the external definition files if this option is used. Default value is false.

order

protected java.lang.String order
Keeps the column name by which the table records will be ordered when executing next query.

filter

protected java.lang.String filter
Keeps the search condition to be applied when getting the records from the table. It must be any SQL statement that can be added after a 'WHERE' clause.

language

protected java.lang.String language
The language attribute to be used to get a static table data. This attribute will only be used if the language attribute of the table has been set to true in the tables catalog.

enterprise

protected java.lang.String enterprise
The enterprise attribute to be used to get a static table data. This attribute will only be used if the enterprise attribute of the table has been set to true in the tables catalog.

classNameForTableAccess

protected java.lang.String classNameForTableAccess
Name of the class to be instantiated and used to access the static tables information. The class must implement the ApplicationTablesService interface.

classNameForTableLoad

protected java.lang.String classNameForTableLoad
Name of the class to be instantiated and used to read the static tables information and load them into memory. The class must implement the ApplicationTablesLoad interface.

loadAllTablesFromServer

protected boolean loadAllTablesFromServer
Flag indicating that the loading of all tables form a remote location is pending.

classNameForTableMemoryCreation

protected java.lang.String classNameForTableMemoryCreation
Name of the class to be instantiated and used to create static tables into memory. The class must implement the ApplicationTablesMemoryCreation interface.

timeout

protected long timeout
Keeps the timeout for the ApplicationTablesServerOp execution.
Constructor Detail

ApplicationTables

public ApplicationTables()
This constructor creates an instance of ApplicationTables.

ApplicationTables

public ApplicationTables(java.lang.String aName)
                  throws java.io.IOException
This constructor creates an instance of ApplicationTables and sets its name attribute to aName.
Parameters:
aName - java.lang.String
Throws:
java.io.IOException -  
Method Detail

addRecord

public void addRecord(java.lang.String aTableName,
                      Vector vectorOfColumnsValues)
               throws DSESQLException,
                      DSEInvalidArgumentException
Inserts in memory a new row in the table aTableName with the values set in the vectorOfColumnsValues vector. The columns information may be got from the tables catalog.
Specified by:
addRecord in interface ApplicationTablesMemoryCreation
Parameters:
aTableName - String, the name of the table
vectorOfColumnsValues - Vector, vector with the values of the records columns
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs

addRecord

public void addRecord(java.lang.String aTableName,
                      Vector vectorOfColumns,
                      Vector vectorOfColumnsValues)
               throws DSESQLException
Inserts a new row in a table that is in memory. A new row will be added to the table specified by aTableName with the values set in the vectorOfColumnsValues vector.
Specified by:
addRecord in interface ApplicationTablesMemoryCreation
Parameters:
aTableName - String, the name of the table
vectorOfColumns - Vector, vector with the names of the records columns
vectorOfColumnsValues - Vector, vector with the values of the records columns
Throws:
DSESQLException - if an SQLException occurs

allRowsToIColl

protected IndexedCollection allRowsToIColl(java.sql.ResultSet aResultSet,
                                           java.lang.String aTableName)
                                    throws DSEInvalidArgumentException,
                                           DSEInternalErrorException,
                                           DSESQLException
Converts all rows in the ResultSet obtained after executing a retrieve SQL statement to a indexed collection of keyed collections.
Parameters:
aResultSet - ResultSet, the rows as a ResultSet
aTableName - String, the table name to be put as name of the indexed collection
Returns:
com.ibm.dse.base.IndexedCollection - an indexed collection of as many keyed collections as rows in the ResultSet
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException occurs

allRowsToRecords

protected Vector allRowsToRecords(java.sql.ResultSet aResultSet,
                                  java.lang.String aTableName)
                           throws DSEInvalidArgumentException,
                                  DSEInternalErrorException,
                                  DSESQLException
Converts all rows in the ResultSet obtained after executing a retrieve SQL statement to a vector of hashtables.
Parameters:
aResultSet - ResultSet, the rows as a ResultSet
Returns:
com.ibm.dse.base.Vector - a Vector of as many Hashtables as rows in the ResultSet
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInternalErrorException - if an internal program error occurs
DSESQLException - if an SQLException occurs

checkForTableInDatabase

public boolean checkForTableInDatabase(java.lang.String aTableName)
                                throws DSESQLException
Returns true if the table exists in memory or false if it does not.
Specified by:
checkForTableInDatabase in interface ApplicationTablesService
Parameters:
aTableName - java.lang.String
Returns:
boolean
Throws:
DSESQLException - if an SQLException occurs

connect

public void connect(java.lang.String aDatabaseURL,
                    java.lang.String aUser,
                    java.lang.String aPassword)
             throws DSESQLException
Establishes a database connection
Specified by:
connect in interface ApplicationTablesService
Parameters:
aDatabaseURL - java.lang.String, the database URL
aUser - java.lang.String, the user identification to connect to the database
aPassword - java.lang.String, the user password to connect to the database
Throws:
DSESQLException - if an SQLException occurs

createTable

public void createTable(java.lang.String tableName)
                 throws DSESQLException,
                        DSEInvalidRequestException
Creates an empty table in memory. When implementing this method, the columns names and types may be obtained from the tables catalog. Used by the service when a table must be loaded into memory, normally the first time the table is accessed from the application.
Specified by:
createTable in interface ApplicationTablesMemoryCreation
Parameters:
aTableName - String, the name of the table
Throws:
DSEInvalidRequestException - if the column names cannot be got
DSESQLException - if an SQLException occurs

createTable

public void createTable(java.lang.String tableName,
                        Vector vectorOfColumns)
                 throws DSESQLException
Creates an empty table in memory with columns as specified in vectorOfColumns. Column types may be obtained from the tables catalog. Used by the service when a table must be loaded into memory, normally the first time the table is accessed from the application.
Specified by:
createTable in interface ApplicationTablesMemoryCreation
Parameters:
aTableName - String, the name of the table
vectorOfColumns - Vector, vector with the names of the records columns
Throws:
DSESQLException - if an SQLException occurs

disconnect

public void disconnect()
                throws DSESQLException
Closes the connection to the database.
Specified by:
disconnect in interface ApplicationTablesService
Throws:
DSESQLException - if an SQLException occurs

dropTable

public void dropTable(java.lang.String aTableName)
               throws DSESQLException
Deletes from memory the table aTableName.
Specified by:
dropTable in interface ApplicationTablesMemoryCreation
Throws:
DSESQLException - if an SQLException occurs

existTable

protected boolean existTable(java.lang.String aTableName)
                      throws DSESQLException,
                             DSEInvalidArgumentException,
                             DSEInvalidRequestException,
                             DSEException
Checks for the table existence either in memory or in the external data storage. If the table is still not in memory, it is read from the external data storage and created in memory.
Parameters:
aTableName - java.lang.String
Returns:
boolean
Throws:
DSEInvalidArgumentException - if the table cannot be found neither in the external data storage nor in memory
DSEInvalidRequestException - if changes control has been requested and the table is not defined in the tables catalog
DSESQLException - if an SQLException occurs
DSEException - if there is a problem reading the table from the external data storage

existTable

protected boolean existTable(java.lang.String aTableName,
                             java.lang.String language,
                             java.lang.String enterprise)
                      throws DSESQLException,
                             DSEInvalidArgumentException,
                             DSEInvalidRequestException,
                             DSEException
Checks for the table existence either in memory or in the external data storage. If the table is still not in memory, it is read from the external data storage and created in memory.
Parameters:
aTableName - java.lang.String
Returns:
boolean
Throws:
DSEInvalidArgumentException - if the table cannot be found neither in the external data storage nor in memory
DSEInvalidRequestException - if changes control has been requested and the table is not defined in the tables catalog
DSESQLException - if an SQLException occurs
DSEException - if there is a problem reading the table from the external data storage

getAllRecords

public Vector getAllRecords(java.lang.String aTableName)
                     throws DSEInvalidArgumentException,
                            DSESQLException,
                            DSEException
Gets all columns of all the records in the table specified by aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data
Specified by:
getAllRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
vectorOfColumnsValues - Vector, vector with the values of the records columns
Returns:
com.ibm.dse.base.Vector - a Vector of as many Hashtables as records in the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getAllRecords

public void getAllRecords(java.lang.String aTableName,
                          HashtableIndexedCollectionFormat aHashtableICollFormat,
                          Context aContext)
                   throws DSEInvalidArgumentException,
                          DSESQLException,
                          DSEException,
                          java.io.IOException
Gets all columns of all records in table aTableName. The context aContext is then updated with the result of the query by the using the formatter named aHashtableICollFormatName. The formatter will convert the Vector of Hashtables into a IndexedCollection of KeyedCollections.
Specified by:
getAllRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
aHashtableICollFormat - HashtableIndexedCollectionFormat, the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getAllRecords

public void getAllRecords(java.lang.String aTableName,
                          HashtableIndexedCollectionFormat aHashtableICollFormat,
                          Context aContext,
                          Vector vectorOfColumns)
                   throws DSEInvalidArgumentException,
                          DSESQLException,
                          DSEException,
                          java.io.IOException
Gets all columns of all records in table aTableName. The context aContext is then updated with the result of the query by the using the formatter named aHashtableICollFormatName. The formatter will convert the Vector of Hashtables into a IndexedCollection of KeyedCollections.
Specified by:
getAllRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
aHashtableICollFormat - HashtableIndexedCollectionFormat, the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getAllRecords

public Vector getAllRecords(java.lang.String aTableName,
                            Vector vectorOfColumns)
                     throws DSEInvalidArgumentException,
                            DSESQLException,
                            DSEException
Gets the columns specified in vectorOfColumns argument of all the records in table specified by aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data
Specified by:
getAllRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Returns:
com.ibm.dse.base.Vector - a Vector of as many Hashtables as records in the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getAllRecords

public void getAllRecords(java.lang.String aTableName,
                          java.lang.String aHashtableICollFormatName,
                          Context aContext)
                   throws DSEInvalidArgumentException,
                          DSESQLException,
                          DSEException,
                          java.io.IOException
Gets all columns of all records in table aTableName. The context aContext is then updated with the result of the query by the using the formatter named aHashtableICollFormatName. The formatter will convert the Vector of Hashtables into a IndexedCollection of KeyedCollections.
Specified by:
getAllRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
aHashtableICollFormatName - String, the name of the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getAllRecords

public void getAllRecords(java.lang.String aTableName,
                          java.lang.String aHashtableICollFormatName,
                          Context aContext,
                          Vector vectorOfColumns)
                   throws DSEInvalidArgumentException,
                          DSESQLException,
                          DSEException,
                          java.io.IOException
Gets the columns specified in vectorOfColumns argument of all records in table aTableName. The context aContext is then updated with the result of the query by the using the formatter named aHashtableICollFormatName. The formatter will convert the Vector of Hashtables into a IndexedCollection of KeyedCollections.
Specified by:
getAllRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
aHashtableICollFormatName - String, the name of the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getClassForTableAccess

protected ApplicationTablesService getClassForTableAccess()
Returns an instance of the class that implements the ApplicationTablesService interface.
Returns:
com.ibm.dse.services.applTables.ApplicationTablesService

getClassForTableLoad

protected ApplicationTablesLoad getClassForTableLoad()
Returns an instance of the class that implements the ApplicationTablesLoad interface.
Returns:
com.ibm.dse.services.applTables.ApplicationTablesLoad

getClassForTableMemoryCreation

protected ApplicationTablesMemoryCreation getClassForTableMemoryCreation()
Returns an instance of the class that implements the ApplicationTablesMemoryCreation interface.
Returns:
com.ibm.dse.services.appltables.ApplicationTablesMemoryCreation

getClassNameForTableAccess

protected java.lang.String getClassNameForTableAccess()
Returns the classNameForTableAccess attribute value.
Returns:
java.lang.String

getClassNameForTableLoad

protected java.lang.String getClassNameForTableLoad()
Returns the classNameForTableLoad attribute value.
Returns:
java.lang.String

getClassNameForTableMemoryCreation

protected java.lang.String getClassNameForTableMemoryCreation()
Returns the classNameForTableMemoryCreation attribute value.
Returns:
java.lang.String

getColumnsNames

public Vector getColumnsNames(java.lang.String aTableName)
                       throws DSESQLException
Returns a Vector holding the names of the columns in the table.
Specified by:
getColumnsNames in interface ApplicationTablesMemoryCreation
Parameters:
aTableName - java.lang.String
Returns:
com.ibm.dse.base.Vector
Throws:
DSESQLException - if an SQLException occurs

getDatabaseInMemoryURL

protected java.lang.String getDatabaseInMemoryURL()
Returns the databaseInMemoryURL attribute value.
Returns:
java.lang.String

getEnterprise

public java.lang.String getEnterprise()
Returns the enterprise attribute value.
Specified by:
getEnterprise in interface ApplicationTablesService
Returns:
java.lang.String

getExternalJDBCDriver

protected java.lang.String getExternalJDBCDriver()
Returns the externalJDBCDriver attribute value.
Returns:
java.lang.String

getExternalPassword

protected java.lang.String getExternalPassword()
Returns the externalPassword attribute value.
Returns:
java.lang.String

getExternalSourceURL

protected java.lang.String getExternalSourceURL()
Returns the externalSourceURL attribute value.
Returns:
java.lang.String

getExternalUserid

protected java.lang.String getExternalUserid()
Returns the externalUserid attribute value.
Returns:
java.lang.String

getFilter

protected java.lang.String getFilter()
Returns the filter attribute value.
Returns:
java.lang.String

getInMemoryConnection

public java.sql.Connection getInMemoryConnection()
Returns the inMemoryConnection attribute value.
Specified by:
getInMemoryConnection in interface ApplicationTablesService
Returns:
java.sql.Connection

getInMemoryJDBCDriver

protected java.lang.String getInMemoryJDBCDriver()
Returns the inMemoryJDBCDriver attribute value.
Returns:
java.lang.String

getInMemoryPassword

protected java.lang.String getInMemoryPassword()
Returns the inMemoryPassword attribute value.
Returns:
java.lang.String

getInMemoryUserid

protected java.lang.String getInMemoryUserid()
Returns the inMemoryUserid attribute value.
Returns:
java.lang.String

getLanguage

public java.lang.String getLanguage()
Returns the language attribute value.
Specified by:
getLanguage in interface ApplicationTablesService
Returns:
java.lang.String

getNextRecords

public Vector getNextRecords(java.lang.String aTableName,
                             int cursorPosition,
                             int numberOfRecords)
                      throws DSESQLException,
                             DSEInvalidArgumentException,
                             DSEException
Gets all columns of the next numberOfRecords records from the position set as cursorPosition in table aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data. If the number of remaining records in the table from the current cursor is less that number of records, only these records will be returned; if the cursor is already positioned after the last record, an empty vector will be returned.
Specified by:
getNextRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
cursorPosition - int, the cursor position to start retrieving the records from
numberOfRecords - int, number of records to be retrieved
Returns:
com.ibm.dse.base.Vector - a Vector of as many Hashtables as retrieved records
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getNextRecords

public int getNextRecords(java.lang.String aTableName,
                          int cursorPosition,
                          int numberOfRecords,
                          HashtableIndexedCollectionFormat aHashtableICollFormat,
                          Context aContext)
                   throws DSESQLException,
                          DSEInvalidArgumentException,
                          DSEException,
                          java.io.IOException
Gets all columns of the next numberOfRecords records from the cursor position set as cursorPosition in table aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data. The context aContext is then updated with the result of the query by using the formatter aHashtableICollFormat. If the number of remaining records in the table from the current cursor is less that number of records, only these records will be returned and the method will return 0; if the cursor is already positioned after the last record, the method will return -1.
Specified by:
getNextRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
cursorPosition - int, the cursor position to start retrieving the records from
numberOfRecords - int, number of records to be retrieved
aHashtableICollFormat - HashtableIndexedCollectionFormat, the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
Returns:
int - new cursor position in the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getNextRecords

public int getNextRecords(java.lang.String aTableName,
                          int cursorPosition,
                          int numberOfRecords,
                          HashtableIndexedCollectionFormat aHashtableICollFormat,
                          Context aContext,
                          Vector vectorOfColumns)
                   throws DSESQLException,
                          DSEInvalidArgumentException,
                          DSEException,
                          java.io.IOException
Gets the columns specified in vectorOfColumns argument of the next numberOfRecords records from the cursor position set as cursorPosition in table aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data. The context aContext is then updated with the result of the query by using the formatter aHashtableICollFormat. If the number of remaining records in the table from the current cursor is less that number of records, only these records will be returned and the method will return 0; if the cursor is already positioned after the last record, the method will return -1.
Specified by:
getNextRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
cursorPosition - int, the cursor position to start retrieving the records from
numberOfRecords - int, number of records to be retrieved
aHashtableICollFormat - HashtableIndexedCollectionFormat, the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Returns:
int - new cursor position in the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getNextRecords

public Vector getNextRecords(java.lang.String aTableName,
                             int cursorPosition,
                             int numberOfRecords,
                             Vector vectorOfColumns)
                      throws DSESQLException,
                             DSEInvalidArgumentException,
                             DSEException
Gets the columns specified in vectorOfColumns argument of the next numberOfRecords records from the position set as cursorPosition in table aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data. If the number of remaining records in the table from the current cursor is less that number of records, only these records will be returned; if the cursor is already positioned after the last record, an empty vector will be returned.
Specified by:
getNextRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
cursorPosition - int, the cursor position to start retrieving the records from
numberOfRecords - int, number of records to be retrieved
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Returns:
com.ibm.dse.base.Vector - a Vector of as many Hashtables as retrieved records
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getNextRecords

public int getNextRecords(java.lang.String aTableName,
                          int cursorPosition,
                          int numberOfRecords,
                          java.lang.String aHashtableICollFormatName,
                          Context aContext)
                   throws DSESQLException,
                          DSEInvalidArgumentException,
                          DSEException,
                          java.io.IOException
Gets all columns of the next numberOfRecords records from the cursor position set as cursorPosition in table aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data. The context aContext is then updated with the result of the query by using the formatter named aHashtableICollFormatName. If the number of remaining records in the table from the current cursor is less that number of records, only these records will be returned and the method will return 0; if the cursor is already positioned after the last record, the method will return -1.
Specified by:
getNextRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
cursorPosition - int, the cursor position to start retrieving the records from
numberOfRecords - int, number of records to be retrieved
aHashtableICollFormatName - String, the name of the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
Returns:
int - new cursor position in the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getNextRecords

public int getNextRecords(java.lang.String aTableName,
                          int cursorPosition,
                          int numberOfRecords,
                          java.lang.String aHashtableICollFormatName,
                          Context aContext,
                          Vector vectorOfColumns)
                   throws DSESQLException,
                          DSEInvalidArgumentException,
                          DSEInternalErrorException,
                          DSEException,
                          java.io.IOException
Gets the columns specified in vectorOfColumns argument of the next numberOfRecords records from the cursor position set as cursorPosition in table aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data. The context aContext is then updated with the result of the query by using the formatter named aHashtableICollFormatName. If the number of remaining records in the table from the current cursor is less that number of records, only these records will be returned and the method will return 0; if the cursor is already positioned after the last record, the method will return -1.
Specified by:
getNextRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
cursorPosition - int, the cursor position to start retrieving the records from
numberOfRecords - int, number of records to be retrieved
aHashtableICollFormatName - String, the name of the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Returns:
int - new cursor position in the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getOrder

protected java.lang.String getOrder()
Returns the order attribute value.
Returns:
java.lang.String

getPrimaryKey

public java.lang.String getPrimaryKey(java.lang.String aTableName)
                               throws DSESQLException
Returns the name of the table aTableName column that is primary key.
Specified by:
getPrimaryKey in interface ApplicationTablesService
Parameters:
aTableName - java.lang.String
Returns:
java.lang.String
Throws:
DSESQLException - if an SQLException occurs

getRecord

public Hashtable getRecord(java.lang.String aTableName,
                           java.lang.Object key)
                    throws DSESQLException,
                           DSEInvalidArgumentException,
                           DSEInvalidRequestException,
                           DSEException
Gets all columns of the record identified by a key from the table aTableName. A Hashtable with key the column name and value the column value is returned.
Specified by:
getRecord in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
key - Object, Object with the key value that identifies the record to be retrieved
Returns:
com.ibm.dse.base.Hashtable - a Hashtable with the retrieved record
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getRecord

public void getRecord(java.lang.String aTableName,
                      java.lang.Object key,
                      HashtableFormat aHashtableFormat,
                      Context aContext)
               throws DSESQLException,
                      DSEInvalidArgumentException,
                      DSEInvalidRequestException,
                      DSEException
Gets all columns of the record identified by a key from the table aTableName. The context aContext is then updated with the result of the query by using the formatter aHashtableFormat.
Specified by:
getRecord in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
key - Object, Object with the key value that identifies the record to be retrieved
aHashtableFormat - HashtableFormat, the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getRecord

public void getRecord(java.lang.String aTableName,
                      java.lang.Object key,
                      HashtableFormat aHashtableFormat,
                      Context aContext,
                      Vector vectorOfColumns)
               throws DSESQLException,
                      DSEInvalidArgumentException,
                      DSEInvalidRequestException,
                      DSEException
Gets the columns specified in vectorOfColumns argument of the record identified by key from the table aTableName. The context aContext is then updated with the result of the query by using the formatter aHashtableFormat.
Specified by:
getRecord in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
aHashtableFormat - HashtableFormat, the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getRecord

public Hashtable getRecord(java.lang.String aTableName,
                           java.lang.Object key,
                           Vector vectorOfColumns)
                    throws DSESQLException,
                           DSEInvalidArgumentException,
                           DSEInvalidRequestException,
                           DSEException
Gets the columns specified in vectorOfColumns argument of the record identified by a key from the table aTableName. A Hashtable with key the column name and value the column value is returned.
Specified by:
getRecord in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
key - Object, Object with the key value that identifies the record to be retrieved
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Returns:
com.ibm.dse.base.Hashtable - a Hashtable with the retrieved record
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getRecord

public void getRecord(java.lang.String aTableName,
                      java.lang.Object key,
                      java.lang.String aHashtableFormatName,
                      Context aContext)
               throws DSESQLException,
                      DSEInvalidArgumentException,
                      DSEInvalidRequestException,
                      DSEException,
                      java.io.IOException
Gets all columns of the record identified by key from the table aTableName. The context aContext is then updated with the result of the query by the using the formatter named aHashtableFormatName.
Specified by:
getRecord in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
aHashtableFormatName - String, the name of the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getRecord

public void getRecord(java.lang.String aTableName,
                      java.lang.Object key,
                      java.lang.String aHashtableFormatName,
                      Context aContext,
                      Vector vectorOfColumns)
               throws DSESQLException,
                      DSEInvalidArgumentException,
                      DSEInvalidRequestException,
                      DSEException,
                      java.io.IOException
Gets the columns specified in vectorOfColumns argument of the record identified by key from the table aTableName. The context aContext is then updated with the result of the query by using the formatter named aHashtableFormatName.
Specified by:
getRecord in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
aHashtableFormatName - String, the name of the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getRecords

public Vector getRecords(java.lang.String aTableName,
                         java.lang.Object keyFrom,
                         java.lang.Object keyTo)
                  throws DSESQLException,
                         DSEInvalidArgumentException,
                         DSEInvalidRequestException,
                         DSEException
Gets all columns of the records with primary key between keyFrom and keyTo values from the table aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data.
Specified by:
getRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
keyFrom - Object, Object with a key value. Only records with primary key value exceeding this value will be retrieved
keyTo - Object, Object with a key value. Only records with primary key value minor than this value will be retrieved
Returns:
com.ibm.dse.base.Vector - a Vector of as many Hashtables as retrieved records
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getRecords

public void getRecords(java.lang.String aTableName,
                       java.lang.Object keyFrom,
                       java.lang.Object keyTo,
                       HashtableIndexedCollectionFormat aHashtableICollFormat,
                       Context aContext)
                throws DSESQLException,
                       DSEInvalidArgumentException,
                       DSEInvalidRequestException,
                       DSEException,
                       java.io.IOException
Gets all columns of the records with primary key between keyFrom and keyTo from the table aTableName. The context aContext is then updated with the result of the query by using the formatter aHashtableICollFormat.
Specified by:
getRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
keyFrom - Object, Object with a key value. Only records with primary key value exceeding this value will be retrieved
keyTo - Object, Object with a key value. Only records with primary key value minor than this value will be retrieved
aHashtableICollFormat - HashtableIndexedCollectionFormat, the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getRecords

public void getRecords(java.lang.String aTableName,
                       java.lang.Object keyFrom,
                       java.lang.Object keyTo,
                       HashtableIndexedCollectionFormat aHashtableICollFormat,
                       Context aContext,
                       Vector vectorOfColumns)
                throws DSESQLException,
                       DSEInvalidArgumentException,
                       DSEInvalidRequestException,
                       DSEException,
                       java.io.IOException
Gets the columns specified in vectorOfColumns argument of the records with primary key between keyFrom and keyTo from the table aTableName. The context aContext is then updated with the result of the query by using the formatter aHashtableICollFormat.
Specified by:
getRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
keyFrom - Object, Object with a key value. Only records with primary key value exceeding this value will be retrieved
keyTo - Object, Object with a key value. Only records with primary key value minor than this value will be retrieved
aHashtableICollFormat - HashtableIndexedCollectionFormat, the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getRecords

public Vector getRecords(java.lang.String aTableName,
                         java.lang.Object keyFrom,
                         java.lang.Object keyTo,
                         Vector vectorOfColumns)
                  throws DSESQLException,
                         DSEInvalidArgumentException,
                         DSEInvalidRequestException,
                         DSEException
Gets the columns specified in vectorOfColumns argument of the records with primary key between keyFrom and keyTo from the table aTableName. A Vector of Hashtables will be returned. Each Hashtable contains the data for one record. The Hashtable key is the column name and the Hashtable value is the column data.
Specified by:
getRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
keyFrom - Object, Object with a key value. Only records with primary key value exceeding this value will be retrieved
keyTo - Object, Object with a key value. Only records with primary key value minor than this value will be retrieved
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Returns:
com.ibm.dse.base.Vector - a Vector of as many Hashtables as retrieved records
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation

getRecords

public void getRecords(java.lang.String aTableName,
                       java.lang.Object keyFrom,
                       java.lang.Object keyTo,
                       java.lang.String aHashtableICollFormatName,
                       Context aContext)
                throws DSESQLException,
                       DSEInvalidArgumentException,
                       DSEInvalidRequestException,
                       DSEException,
                       java.io.IOException
Gets all columns of the records with primary key between keyFrom and keyTo from the table aTableName. The context aContext is then updated with the result of the query by using the formatter named aHashtableICollFormatName.
Specified by:
getRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
keyFrom - Object, Object with a key value. Only records with primary key value exceeding this value will be retrieved
keyTo - Object, Object with a key value. Only records with primary key value minor than this value will be retrieved
aHashtableICollFormatName - String, the name of the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getRecords

public void getRecords(java.lang.String aTableName,
                       java.lang.Object keyFrom,
                       java.lang.Object keyTo,
                       java.lang.String aHashtableICollFormatName,
                       Context aContext,
                       Vector vectorOfColumns)
                throws DSESQLException,
                       DSEInvalidArgumentException,
                       DSEInvalidRequestException,
                       DSEException,
                       java.io.IOException
Gets the columns specified in vectorOfColumns argument of the records with primary key between keyFrom and keyTo from the table aTableName. The context aContext is then updated with the result of the query by using the formatter named aHashtableICollFormatName.
Specified by:
getRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
keyFrom - Object, Object with a key value. Only records with primary key value exceeding this value will be retrieved
keyTo - Object, Object with a key value. Only records with primary key value minor than this value will be retrieved
aHashtableICollFormatName - String, the name of the formatter to be used to unformat the retrieved data
aContext - Context, the context that will be updated with the retrieved data
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSEInvalidRequestException - if the primary key name cannot be found
DSESQLException - if an SQLException occurs
DSEException - if an exception occurs when running the Application Tables operation
java.io.IOException - if there is a problem when reading the formatter from its external definition

getTableNames

public Vector getTableNames()
                     throws DSESQLException
Returns a Vector with the name of all tables created in the memory database.
Specified by:
getTableNames in interface ApplicationTablesService
Returns:
com.ibm.dse.base.Vector

getTableRecords

public java.lang.Object getTableRecords(java.lang.String aTableName,
                                        java.lang.String stOrder,
                                        java.lang.String stFilter)
                                 throws DSESQLException
Returns an Object containing all the records in the table aTable name matching the stFilter search condition and ordered as set in the stOrder argument.
Specified by:
getTableRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
stOrder - String, name of the column the retrieve records will be ordered by
stFilter - String, additional search condition
Returns:
Object - Object keeping all table records information
Throws:
DSESQLException - if an SQLException occurs

getTableRecords

public java.lang.Object getTableRecords(java.lang.String aTableName,
                                        java.lang.String stOrder,
                                        java.lang.String stFilter,
                                        Vector vectorOfColumns)
                                 throws DSESQLException
Returns an Object containing all records in the table aTable name matching the stFilter search condition and ordered as set in the stOrder argument. Only the columns specified in the vectorOfColumns vector should be retrieved.
Specified by:
getTableRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
stOrder - String, name of the column the retrieve records will be ordered by
stFilter - String, additional search condition
vectorOfColumns - Vector, vector with the name of the columns that will be retrieved from the table
Returns:
Object - Object keeping all table records information
Throws:
DSESQLException - if an SQLException occurs

getTablesCatalog

protected Hashtable getTablesCatalog()
Returns the tables catalog.
Returns:
com.ibm.dse.base.Hashtable

getTimeout

protected long getTimeout()
Returns the timeout attribute value.
Returns:
long

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEInvalidArgumentException,
                                       DSEException,
                                       DSESQLException
Used by the ApplicationTables service externalizer to set the 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:
IOException - if an I/O Exception has occurred

initializeTableFrom

public java.lang.Object initializeTableFrom(Tag aTag)
Used by the ApplicationTables service externalizer to create the tables catalog from its external definition.
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

isChangesControl

protected boolean isChangesControl()
Returns the changesControl attribute value.
Returns:
boolean

isLoadAllTables

protected boolean isLoadAllTables()
Returns the loadAllTables attribute value.
Returns:
boolean

isSearchRemotelly

protected boolean isSearchRemotelly()
Returns the searchRemotelly attribute value.
Returns:
boolean

loadTableFromExternalSource

public void loadTableFromExternalSource()
                                 throws DSEInvalidArgumentException,
                                        DSESQLException,
                                        DSEException
Reads the table and its contents from an external data storage and calls the ApplicationTablesMemoryCreation methods to create the table in memory. If no arguments are specified, all tables defined in the external source will be loaded and the external source details ( if any) will be obtained from the service definition
Specified by:
loadTableFromExternalSource in interface ApplicationTablesLoad
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if there is no connection available to the database in memory

loadTableFromExternalSource

public void loadTableFromExternalSource(java.lang.String language,
                                        java.lang.String enterprise)
                                 throws DSEInvalidArgumentException,
                                        DSESQLException,
                                        DSEException
Reads the table and its contents from an external data storage and calls the ApplicationTablesMemoryCreation methods to create the table in memory. This method allows specification of which language and enterprise to use. Null or blank values for all these arguments are accepted to indicate that this argument is not needed.
Parameters:
language - String, language of the table to be loaded
enterprise - String, enterprise of the table to be loaded
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if there is no connection available to the database in memory

loadTableFromExternalSource

public boolean loadTableFromExternalSource(java.lang.String aTableName,
                                           java.lang.String version,
                                           java.lang.String release,
                                           java.lang.String language,
                                           java.lang.String enterprise)
                                    throws DSESQLException,
                                           DSEInvalidArgumentException,
                                           DSEException
Reads the table aTableName and its contents from an external data storage and calls the ApplicationTablesMemoryCreation methods to create the table in memory. Returns true if the table have been found and false otherwise. This method allows specification of which version and release has to be loaded, and which language and enterprise to use. Null or blank values for all these arguments , except for tableName, are accepted to indicate that this argument is not needed.
Specified by:
loadTableFromExternalSource in interface ApplicationTablesLoad
Parameters:
aTableName - String, the name of the table
version - String, version of the table to be loaded
release - String, release of the table to be loaded
language - String, language of the table to be loaded
enterprise - String, enterprise of the table to be loaded
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEException - if there is no connection available to the database in memory

manageRecord

public Hashtable manageRecord(java.lang.String aTableName,
                              java.lang.Object records)
                       throws DSEInvalidArgumentException,
                              DSESQLException,
                              DSEInternalErrorException
Returns a Hashtable containing the data of the record retrieved by executing the getTableRecords() method. The Hashtable key is the column name and the value is the column value.
Specified by:
manageRecord in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
records - Object, an Object with the retrieved record information
Returns:
com.ibm.dse.base.Hashtable - A Hashtable with the retrieved record data
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEInternalErrorException - if an exception occurs when converting the record data into a Hashtable

manageRecords

public Vector manageRecords(java.lang.String aTableName,
                            int cursorPosition,
                            int numberOfRecords,
                            java.lang.Object records)
                     throws DSEInvalidArgumentException,
                            DSESQLException,
                            DSEInternalErrorException
Returns a Vector of Hashtables. Each Hashtable contains the data for one of the records obtained by calling the getTableRecords() method . The size of the Vector of Hashtables will be less or equal to numberOfRecords and the first record will be the one in the cursorPosition position. The Hashtable key is the column name and the Hashtable value is the column data.
Specified by:
manageRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
cursorPosition - int, the cursor position to start retrieving the records from
numberOfRecords - int, number of records to be retrieved from the set of all retrieved records
records - Object, an Object with the retrieved record information
Returns:
com.ibm.dse.base.Vector - A Vector of Hashtables each one holding one of the retrieved records
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEInternalErrorException - if an exception occurs when converting the record data into a Hashtable

manageRecords

public Vector manageRecords(java.lang.String aTableName,
                            java.lang.Object records)
                     throws DSEInvalidArgumentException,
                            DSESQLException,
                            DSEInternalErrorException
Returns a Vector of Hashtables. Each Hashtable contains the data for one of the records obtained by calling the getTableRecords() method . The Hashtable key is the column name and the Hashtable value is the column data.
Specified by:
manageRecords in interface ApplicationTablesService
Parameters:
aTableName - String, the name of the table
records - Object, an Object with the retrieved record information
Returns:
com.ibm.dse.base.Vector - A Vector of Hashtables each one holding one of the retrieved records
Throws:
DSEInvalidArgumentException - if the parameters are not correct
DSESQLException - if an SQLException occurs
DSEInternalErrorException - if an exception occurs when converting the record data into a Hashtable

selectTable

protected java.sql.ResultSet selectTable(java.lang.String stTable,
                                         Vector vColumns,
                                         Vector vValues,
                                         java.lang.String stOrder,
                                         java.lang.String stFilter)
                                  throws DSESQLException
Executes a database query to get the requested records from the table.
Parameters:
stTable - String, the name of the table
vColumns - Vector, vector with the name of the columns that will be retrieved from the table
vValues - Vector, vector with the values of the columns that will be retrieved from the table
stOrder - String, name of the column the retrieve records will be ordered by
stFilter - String, additional search condition
Returns:
ResultSet
Throws:
DSESQLException - if an SQLException occurs

setChangesControl

protected void setChangesControl(boolean newChangesControl)
Sets the changesControl attribute value to newChangesControl.
Parameters:
newChangesControl - boolean

setClassNameForTableAccess

protected void setClassNameForTableAccess(java.lang.String newClassNameForTableAccess)
Sets the classNameForTableAccess attribute value to newClassNameForTableAccess.
Parameters:
newClassNameForTableAccess - java.lang.String

setClassNameForTableLoad

protected void setClassNameForTableLoad(java.lang.String newClassNameForTableLoad)
Sets the classNameForTableLoad attribute value to newClassNameForTableLoad.
Parameters:
newClassNameForTableLoad - java.lang.String

setClassNameForTableMemoryCreation

protected void setClassNameForTableMemoryCreation(java.lang.String newClassNameForTableMemoryCreation)
Sets the classNameForTableMemoryCreation attribute value to newClassForTableMemoryCreation.
Parameters:
newClassNameForTableMemoryCreation - java.lang.String

setDatabaseInMemoryURL

protected void setDatabaseInMemoryURL(java.lang.String newDatabaseURL)
Sets the databaseInMemoryURL attribute value to newDatabaseURL.
Parameters:
newDatabaseURL - java.lang.String

setEnterprise

protected void setEnterprise(java.lang.String newEnterprise)
Sets the enterprise attribute value to newEnterprise.
Parameters:
newEnterprise - java.lang.String

setExternalJDBCDriver

protected void setExternalJDBCDriver(java.lang.String newJDBCDriver)
Sets the externalJDBCDriver attribute value to newJDBCDriver.
Parameters:
newJDBCDriver - java.lang.String

setExternalPassword

protected void setExternalPassword(java.lang.String newExternalPassword)
Sets the externalPassword attribute value to newExternalPassword.
Parameters:
newExternalPassword - java.lang.String

setExternalSourceURL

protected void setExternalSourceURL(java.lang.String newExternalSourceURL)
Sets the externalSourceURL attribute value to newExternalSourceURL.
Parameters:
newExternalSourceURL - java.lang.String

setExternalUserid

protected void setExternalUserid(java.lang.String newExternalUserid)
Sets the externalUserid attribute value to newExternalUserid.
Parameters:
newExternalUserid - java.lang.String

setFilter

public void setFilter(java.lang.String newFilter)
Sets the filter attribute value to newFilter.
Parameters:
newFilter - java.lang.String

setInMemoryJDBCDriver

protected void setInMemoryJDBCDriver(java.lang.String newJDBCDriver)
Sets the inMemoryJDBCDriver attribute value to newJDBCDriver.
Parameters:
newJDBCDriver - java.lang.String

setInMemoryPassword

protected void setInMemoryPassword(java.lang.String newPassword)
Sets the inMemoryPassword attribute value to newPassword.
Parameters:
newPassword - java.lang.String

setInMemoryUserid

protected void setInMemoryUserid(java.lang.String newUserid)
Sets the inMemoryUserid attribute value to newUserid.
Parameters:
newUserid - java.lang.String

setLanguage

protected void setLanguage(java.lang.String newLanguage)
Sets the language attribute value to newLanguage.
Parameters:
newLanguage - java.lang.String

setLoadAllTables

protected void setLoadAllTables(boolean newLoadAllTables)
Sets the loadAllTables attribute value to newLoadAllTables.
Parameters:
newLoadAllTables - boolean

setOrder

public void setOrder(java.lang.String newOrder)
Sets the order attribute value to newOrder.
Parameters:
newOrder - java.lang.String

setSearchRemotelly

protected void setSearchRemotelly(boolean newSearchRemotelly)
Sets the searchRemotelly attribute value to newSearchRemotelly.
Parameters:
newSearchRemotelly - boolean

setTimeout

protected void setTimeout(long newTimeout)
Sets the timeout attribute value to newTimeout.
Parameters:
newTimeout - long

terminate

public void terminate()
               throws DSEException
Contains all needed code to be executed when the service is no more being used.
Overrides:
terminate in class Service

toStrings

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

updateAllTablesInMemory

protected void updateAllTablesInMemory(IndexedCollection allTables)
                                throws DSESQLException,
                                       DSEInvalidRequestException,
                                       DSEObjectNotFoundException
This method is call when getting the reply from the server after the ApplicationTablesClientOp operation execution with table name "allTables". It creates all the tables and for each table it adds the records from the information returned in the operation context as an indexed collection of indexed collections of keyed collections.
Parameters:
responseData - IndexedCollection, the collection of tables information as returned from the server
Throws:
DSESQLException - if an SQLException occurs
DSEInvalidRequestException - if the table name cannot be got from the IndexedCollection

updateTablesInMemory

protected void updateTablesInMemory(IndexedCollection responseData)
                             throws DSESQLException,
                                    DSEInvalidRequestException,
                                    DSEObjectNotFoundException
This method is call when getting the reply from the server after the ApplicationTablesClientOp operation execution. It creates the table and adds the records from the information returned in the operation context as an indexed collection of keyed collections.
Parameters:
responseData - IndexedCollection, the table information as returned from the server
Throws:
DSESQLException - if an SQLException occurs
DSEInvalidRequestException - if the table name cannot be got from the IndexedCollection