com.ibm.dse.services.appltables
Interface ApplicationTablesMemoryCreation

All Known Implementing Classes:
ApplicationTables

public interface ApplicationTablesMemoryCreation

Defines the methods that must be implemented by a service creating or removing a table to/from memory.


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.
 void connect(java.lang.String aDatabaseURL, java.lang.String aUser, java.lang.String aPassword)
          Establishes a database connection
 void createTable(java.lang.String aTableName)
          Creates an empty table in memory.
 void createTable(java.lang.String aTableName, 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.
 Vector getColumnsNames(java.lang.String aTableName)
          Returns a Vector holding the names of the columns in the table.
 java.sql.Connection getInMemoryConnection()
          Returns the inMemoryConnection attribute value.
 

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

connect

public void connect(java.lang.String aDatabaseURL,
                    java.lang.String aUser,
                    java.lang.String aPassword)
             throws DSESQLException
Establishes a database connection
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 aTableName)
                 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.
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 aTableName,
                        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.
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.
Throws:
DSESQLException - if an SQLException occurs

dropTable

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

getColumnsNames

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

getInMemoryConnection

public java.sql.Connection getInMemoryConnection()
Returns the inMemoryConnection attribute value.
Returns:
java.sql.Connection