| |
|
| java.lang.Object net.xoetrope.optional.data.sql.DatabaseTable
All known Subclasses: net.xoetrope.optional.data.sql.CachedDatabaseTable,
DatabaseTable | public class DatabaseTable (Code) | | A holder for information about a database table and the result set obtained
from a database query.
Copyright (c) Xoetrope Ltd. 2001-2003
$Revision: 1.8 $
|
NORMAL_UPDATE | final public static int NORMAL_UPDATE(Code) | | The database will attempt to synchronize periodically
|
OPTIMISTIC_UPDATE | final public static int OPTIMISTIC_UPDATE(Code) | | The database will only attempt to synchronize when absolutely necessary
|
PARANOID_UPDATE | final public static int PARANOID_UPDATE(Code) | | The database will always attemp to synchronize
|
caseSensitive | protected static boolean caseSensitive(Code) | | |
currentRow | protected int currentRow(Code) | | |
dirty | protected boolean dirty(Code) | | |
distinct | protected boolean distinct(Code) | | |
numFields | protected int numFields(Code) | | |
numRows | protected int numRows(Code) | | |
writable | protected boolean writable(Code) | | |
DatabaseTable | public DatabaseTable(String tableName)(Code) | | Create a new database table wrapper
Parameters: tableName - the table name |
DatabaseTable | public DatabaseTable(String sql, String conn, boolean allowWrites)(Code) | | Create a new database table wrapper
Parameters: sql - the SQL query for the table Parameters: conn - the connection name Parameters: allowWrites - true if the result set is to be updatable |
DatabaseTable | public DatabaseTable(String tableName, String fields, String where, String conn, boolean allowWrites)(Code) | | Create a new database table wrapper
Parameters: tableName - the table name Parameters: fields - the fields to retrieve Parameters: where - the where clause to use in the query Parameters: conn - the connection name Parameters: allowWrites - true if the result set is to be updatable |
cacheData | protected void cacheData()(Code) | | |
executeUpdate | public int executeUpdate(String sql) throws Exception(Code) | | Execute an update statement
Parameters: sql - the UPDATE SQL statement throws: Exception - |
first | public void first()(Code) | | |
getConnName | public String getConnName()(Code) | | Get the connection name
the connection names |
getCurrentRow | public int getCurrentRow()(Code) | | Gets the current row.
the new row index - 0 based |
getFieldIndex | public int getFieldIndex(String fieldName)(Code) | | Get the index (zero based) of a named field
Parameters: fieldName - the field name the index |
getFieldName | public String getFieldName(int fieldIdx)(Code) | | Get the name of a field
Parameters: fieldIdx - the field index (zero based) the index |
getFields | public String getFields()(Code) | | Gets the fields used for the query
the where clause |
getNumFields | public int getNumFields()(Code) | | get the number of fields in the table
the number of fields |
getNumRows | public int getNumRows()(Code) | | Get the number of rows/records in the resultset/table
|
getSQL | public String getSQL(String where)(Code) | | Get the SQL for the SELECT statement or return the SQL that was specified
Parameters: where - the where clause if any the SQL statement |
getTableName | public String getTableName()(Code) | | Gets the table name
the table name |
getTableName | public void getTableName(String name)(Code) | | Get the table name
Parameters: name - the table name |
getValue | public String getValue(int fieldIdx)(Code) | | Get a field value
Parameters: fieldIdx - the (zero based) field index the value |
getValue | public String getValue(int rowIdx, int fieldIdx)(Code) | | Get a field value
Parameters: rowIdx - the (zero based) row index Parameters: fieldIdx - the (zero based) field/column index |
getWhereClause | public String getWhereClause()(Code) | | Gets the value of any where clause
the where clause |
isDistinct | public boolean isDistinct()(Code) | | Check if the table is set to retrieve distinct rows
the distinct flag |
next | public boolean next()(Code) | | |
previous | public boolean previous()(Code) | | |
retrieve | public void retrieve()(Code) | | Retrieve values using the deafult where clause
|
retrieve | public void retrieve(String where)(Code) | | Retrieve values using the specified where clause. If a SQL statement has
been specified in its entirety then the where clause argument is ignored.
Parameters: where - the SQL where statement (without the WHERE) |
setCaseSensitive | public static void setCaseSensitive(boolean state)(Code) | | Set the case sensitivity for database comparisons. This setting is
application wide
Parameters: state - true for case-sensitive comparisons of field names |
setCurrentRow | public void setCurrentRow(int idx)(Code) | | Sets the current row.
Parameters: idx - the new row index - 0 based |
setDistinct | public void setDistinct(boolean isDistinct)(Code) | | Set the table to retrieve distinct rows
|
setOrderField | public void setOrderField(String fld)(Code) | | Set the field name(s) for the ORDER clause
Parameters: fld - |
setValue | public void setValue(int rowIdx, int fieldIdx, String value)(Code) | | Set a field value
Parameters: rowIdx - the (zero based) row index Parameters: fieldIdx - the (zero based) field/column index Parameters: the - new field value |
|
|
|