|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
An interface that specifies methods for accessing a database. This interface specifies a fairly rich set of database query and management routines. All calls in Intradoc to a database go through an implementation of this interface.
ResultSet| Field Summary | |
static int |
COMPACT
Used for MS Access databases to specify that the database should be compacted. |
| Method Summary | |
void |
addIndex(java.lang.String table,
java.lang.String[] indexCols)
Adds an index used for optimizing queries. |
void |
addQuery(SimpleQueryInfo qInfo)
Adds a parameterized query to the object that implements this interface. |
void |
addQueryDefs(DataResultSet rset)
Adds queries from a table. |
void |
alterTable(java.lang.String table,
FieldInfo[] addCols,
java.lang.String[] dropCols,
java.lang.String[] primaryKeys)
Method adds and deletes columns from a database table. |
void |
beginTran()
Starts a database transaction. |
boolean |
checkQuery(java.lang.String query,
Parameters args)
Validates that the Parameters interface supplies all the necessary parameters for the query. |
void |
commitTran()
Commits the database transaction. |
ResultSet |
createResultSet(java.lang.String query,
Parameters args)
Executes a parameterized query that returns a result set. |
ResultSet |
createResultSetSQL(java.lang.String sql)
Executes SQL that returns a result set. |
void |
createTable(java.lang.String table,
FieldInfo[] cols,
java.lang.String[] primaryKeys)
Creates a table in the database. |
void |
dbManagement(int type,
Parameters args)
A general management or configuration function whose appropriate values for its arguments are dependent on the object that implements this interface. |
void |
deleteTable(java.lang.String table)
Deletes a table from the database. |
java.lang.String |
dumpQuery(java.lang.String query,
Parameters args)
Creates debug dump of a query using the values supplied by the Parameters interface. |
long |
execute(java.lang.String function,
Parameters args)
Executes a parameterized query. |
long |
executeSQL(java.lang.String sql)
Executes SQL. |
FieldInfo[] |
getColumnList(java.lang.String tableName)
Method returns list of FieldInfo corresponding to the columns in the table. |
java.lang.String[] |
getPrimaryKeys(java.lang.String table)
Method returns list of columns that make up the primary key. |
java.lang.String |
getProperty(java.lang.String key)
General function that allow retreiving Workspace specific properties. |
java.lang.String[] |
getQueryList()
Returns the names of all the parameterized queries in this Workspace. |
java.lang.String[] |
getQueryParameters(java.lang.String query)
Lists the names of parameters that need to filled in order to execute a parameterized query. |
java.lang.String[] |
getTableList()
Returns all table names currently in the database. |
void |
initConnections(int num)
Initializes the Workspace object with connection attributes. |
void |
releaseConnection()
Used to release a connection to the database back into the cache of pooled database connetions. |
void |
releaseConnection(java.lang.String threadName)
Releases a connection from the named thread. |
void |
removeQuery(java.lang.String query)
Removeds a parameterized query. |
void |
rollbackTran()
Cancels a database transaction. |
boolean |
supportsSqlColumnChange()
Method returns a value indicating whether or not a varchar column can have its length extended without recreating the entire table. |
boolean |
supportsSqlColumnDelete()
Method returns a value indicating whether or not a column can be deleted from a database table without recreating the entire table. |
| Field Detail |
public static final int COMPACT
| Method Detail |
public void initConnections(int num)
throws DataException
DataException - Thrown if there was an error doing the initialization.
public long execute(java.lang.String function,
Parameters args)
throws DataException
function - The name of the parameterized query that uses '?' as place
holders for arguments. Each '?' mark is associated with a lookup key as part
of the definition of the parameterized query.args - An interface through which the values to fill in the parameters
of the query can be extracted.
DataException - Thrown if there is an error executing the query.addQueryDefs(intradoc.data.DataResultSet),
addQuery(intradoc.data.SimpleQueryInfo)
public long executeSQL(java.lang.String sql)
throws DataException
DataException - Thrown if there is an error executing the query.
public ResultSet createResultSet(java.lang.String query,
Parameters args)
throws DataException
args - An interface through which the values to fill in the parameters
of the query can be extracted.
DataException - Thrown if there is an error executing the query.execute(java.lang.String, intradoc.data.Parameters)
public ResultSet createResultSetSQL(java.lang.String sql)
throws DataException
DataException - Thrown if there is an error executing the query.executeSQL(java.lang.String)
public void beginTran()
throws DataException
DataException - Thrown if transaction cannot be started.commitTran(),
rollbackTran()
public void commitTran()
throws DataException
DataException - Thrown if transaction cannot be commited.public void rollbackTran()
public java.lang.String[] getQueryList()
public java.lang.String[] getTableList()
throws DataException
DataException - Thrown if table list cannot be retrieved.createTable(java.lang.String, intradoc.data.FieldInfo[], java.lang.String[])
public FieldInfo[] getColumnList(java.lang.String tableName)
throws DataException
tableName -
DataException
public void createTable(java.lang.String table,
FieldInfo[] cols,
java.lang.String[] primaryKeys)
throws DataException
table - Name of table to created.cols - Specifications of the fields to use as columns for the database table.primaryKeys - An array holding the fields that will make up the primary key.
DataException - Thrown if table cannot be created.
public void deleteTable(java.lang.String table)
throws DataException
table - Name of table to deleted.
DataException - Thrown if table cannot be deleted.
public void alterTable(java.lang.String table,
FieldInfo[] addCols,
java.lang.String[] dropCols,
java.lang.String[] primaryKeys)
throws DataException
table - Name of table to alter.
DataException - Thrown if table cannot be altered.supportsSqlColumnDelete(),
supportsSqlColumnChange()public boolean supportsSqlColumnDelete()
public boolean supportsSqlColumnChange()
public java.lang.String[] getPrimaryKeys(java.lang.String table)
throws DataException
table -
DataException - Thrown if error is encountered
public void addIndex(java.lang.String table,
java.lang.String[] indexCols)
throws DataException
table - The table that is to get the new index.indexCols - The name of the fields that will make up the index.
DataException - Thrown if index cannot be added.
public void addQuery(SimpleQueryInfo qInfo)
throws DataException
qInfo - An object containing the information necessary to specify
a simple parameterized query.
DataException - Thrown if query cannot be added.
public void removeQuery(java.lang.String query)
throws DataException
DataException - Thrown if query cannot be removed.
public java.lang.String[] getQueryParameters(java.lang.String query)
throws DataException
query - The name of the query.
DataException - Thrown if parameters cannot be retrieved.
public boolean checkQuery(java.lang.String query,
Parameters args)
throws DataException
DataException - Thrown if query cannot be validated.
public java.lang.String dumpQuery(java.lang.String query,
Parameters args)
throws DataException
query - The name of the parameterized query.args - The source of the data to fill the query.
DataException - Thrown if debug string for query cannot be creatd.public void releaseConnection()
public void releaseConnection(java.lang.String threadName)
releaseConnection
public void addQueryDefs(DataResultSet rset)
throws DataException
rset - A result set containing information about parameterized
queries to load.
DataException - Thrown if the queries could not be added.public java.lang.String getProperty(java.lang.String key)
public void dbManagement(int type,
Parameters args)
throws DataException
type - An integer argument specifying what management function to perform (Ex:
the value may be 'COMPACT' for a MS Access database to specify that the database
should be compacted.)args - Optional arguments whose appropriate values are dependent on the
management service specified.
DataException - Thrown if there is an error perfoming management function.COMPACT
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
(c) 1996-2005 All rights reserved. Stellent, Inc. |