|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.optional.data.sql.DatabaseTable
net.xoetrope.optional.data.sql.CachedDatabaseTable
public class CachedDatabaseTable
A class that extends the DatabaseTable class by caching the data from the query result set. This class maintains a copy of the database tables's data and has limited updated capabilities. The class is designed for use as a disconnected rowset. At some stage we may replace its implementation with the JDBC CachedRowSet
Copyright (c) Xoetrope Ltd. 2001-2005
$Revision: 2.8 $ License: see license.txt
| Field Summary | |
|---|---|
protected java.lang.String |
origSQL
|
protected java.lang.Object[] |
rowData
|
| Fields inherited from class net.xoetrope.optional.data.sql.DatabaseTable |
|---|
caseSensitive, connection, connName, currentProject, currentRow, defaultWhereClause, dirty, distinct, fieldNames, fieldTypes, NORMAL_UPDATE, numFields, numRows, OPTIMISTIC_UPDATE, orderField, params, PARANOID_UPDATE, queryFields, queryTable, RS, sqlStatement, writable |
| Constructor Summary | |
|---|---|
CachedDatabaseTable(XProject project,
java.lang.String sqlStr,
java.lang.String connName,
boolean writable)
Setup a table with the full sql statement |
|
CachedDatabaseTable(XProject project,
java.lang.String tableName,
java.lang.String fields,
java.lang.String where,
java.lang.String connName,
boolean writable)
Create a new database table wrapper |
|
| Method Summary | |
|---|---|
protected void |
cacheData()
Internally store the latest result set data and then close the dataset |
java.lang.String |
getOriginalSql()
|
java.lang.String |
getValue(int fieldIdx)
Get a field value from the current row |
java.lang.String |
getValue(int rowIdx,
int fieldIdx)
Get a field value |
void |
setValue(int rowIdx,
int fieldIdx,
java.lang.String value)
Set the cache value for a field. |
void |
setValue(int fieldIdx,
java.lang.String value)
Set the cache value for a field. |
| Methods inherited from class net.xoetrope.optional.data.sql.DatabaseTable |
|---|
commit, executeUpdate, finalize, first, getConnName, getCurrentRow, getDoesEscapeProcessing, getFieldIndex, getFieldName, getFields, getNextPseudoId, getNumFields, getNumRows, getPreparedStatement, getPreparedStatement, getSQL, getTableName, getTableName, getWhereClause, hasMoreRows, isDistinct, last, next, previous, releasePreparedStatement, retrieve, retrieve, retrieve, setAutoCommit, setCaseSensitive, setCurrentRow, setDistinct, setDoesEscapeProcessing, setOrderField, setParams, setSql |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object[] rowData
protected java.lang.String origSQL
| Constructor Detail |
|---|
public CachedDatabaseTable(XProject project,
java.lang.String sqlStr,
java.lang.String connName,
boolean writable)
project - the owner projectsqlStr - the full SQL statementconnName - the connection namewritable - true if the table is writeable/updatable
public CachedDatabaseTable(XProject project,
java.lang.String tableName,
java.lang.String fields,
java.lang.String where,
java.lang.String connName,
boolean writable)
project - the owner projecttableName - the table namefields - the fields to retrievewhere - the where clause to use in the queryconnName - the connection namewritable - true if the result set is to be updatable| Method Detail |
|---|
public java.lang.String getOriginalSql()
protected void cacheData()
throws java.sql.SQLException
cacheData in class DatabaseTablejava.sql.SQLExceptionpublic java.lang.String getValue(int fieldIdx)
getValue in class DatabaseTablefieldIdx - the field (zero based) to retrieve
public java.lang.String getValue(int rowIdx,
int fieldIdx)
getValue in class DatabaseTablerowIdx - the row (zero based) to retrievefieldIdx - the field (zero based) to retrieve
public void setValue(int fieldIdx,
java.lang.String value)
value - the new field valuefieldIdx - the field (zero based) to retrieve
public void setValue(int rowIdx,
int fieldIdx,
java.lang.String value)
setValue in class DatabaseTablevalue - the new field valuerowIdx - the row (zero based) to retrievefieldIdx - the field (zero based) to retrieve
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||