| com.sun.sql.rowset.CachedRowSetX
All known Subclasses: com.sun.sql.rowset.CachedRowSetXImpl5,
CachedRowSetX | public interface CachedRowSetX extends CachedRowSet(Code) | | The extened interface that all implementations of
com.sun.sql.rowset.CachedRowSetX must implement.
1.0 Overview
An extension to the CachedRowSet interface.
A
com.sun.sql.rowset.CachedRowSetX object differs from a CachedRowSet object
in the following ways:
- An
isExecuted() method will return true if
the
com.sun.sql.rowset.CachedRowSetX is in a state where navigation and getters
and setters can be called on rows returned from the database (i.e., returns
true if execute or populate has been called.
- The following "advanced" properties have been added. These properties are
useful in the case of incomplete or incorrect information being supplied by
JDBC drivers.
Note: In most cases, these advanced properties do not need to be set (i.e., they can be
left set to their default null value (or false in the
case of printStatements ). For the cases where the advanced properties
must be used, it is helpful to set the printStatements property to
true first. In that way, one can then determine what advanced
properties must be set. By setting the catalog and schema for the table to be
upadted and by explicitly setting cataloag, table, schema and column names for
each column, one can explicitly set what columns will participate in inserts,
updates and deletes. Futher control can be gained by setting the updatableColumns
and insertableColumns properties. Note: if updatableColumns is set and
insertableColumns is not set, it is assumed that updateableColumns applies to
both updates and inserts.
catalogName : the name of the catalog that contains the table referred to by tableName
schemaName : the name of the schema that contains the table referred to by tableName
columnCatalogNames : an array of
String , one for each column, which contains the name of catalog of the corresponding column (each element can also be null
columnSchemaNames : an array of
String , one for each column, which contains the name of the schema of the corresponding column (each element can also be null
columnTableNames : an array of
String , one for each column, which contains the name of the table of the corresponding column (each element can also be null
columnNames : an array of
String , one for each column, which contains the name of the corresponding column (each element can also be null
insertableColumns : an array of boolean , one for each column, which contains true if the corresponding column can be inserted, else it contains false/code>
updatableColumns : an array of boolean , one for each column, which contains true if the corresponding column can be updated, else it contains false/code>
printStatements : a boolean{/code> that when true will result in internally generated INSERT , UPDATE , and DELETE SQL statements being written to System.out . This output is useful in determining why inserts,updates and/or deletes are falling and in deciding what advanced properties to set in order to address the problems.
-
PropertyChangeListener support
The following are bound properties:
command
dataSourceName
maxRows
password
type
url
username
- support to use the
com.sun.sql.rowset.CachedRowSetX after calling
close on it.
- by default, a
com.sun.sql.rowset.CachedRowSetX 's properties are set to:
command : null
escapeProcessing : true
keyColumns : null (ignored)
maxFieldSize : 0
maxRows : 0
password : null
readOnly : true (ignored)
showDeleted : false
typeMap : null
url : null
username : null
- the
readOnly property is currently not used
- it is well defined how property changes affect the state of a
com.sun.sql.rowset.CachedRowSetX
autoCommit : nothing is invalidated
command : release() is called
concurrency : nohting is invalidated
escapeProcessing : nothing is invalidated
maxFieldSize : nothing is invalidated
maxRows : nothing is invalidated
password : nothing is invalidated
readOnly : nothing is invalidated
showDeleted : nothing is invalidated
transactionIsolation : nothing is invalidated
type : nothing is invalidated
typeMap : nothing is invalidated
url : release() is called
username : release() is called
- calling
close will never throw a SQLException
|
Method Summary | |
public void | addPropertyChangeListener(PropertyChangeListener listener) Add a PropertyChangeListener to the listener list. | public void | addPropertyChangeListener(String propertyName, PropertyChangeListener listener) Add a PropertyChangeListener for a specific property. | public String | getCatalogName() Returns the catalog in which the table referred to by the tableName property
resides. | public String[] | getColumnCatalogNames() Returns an array of
String . | public String | getColumnCatalogNames(int index) Returns a
String which contains the catalog name set for the column or
null . | public String[] | getColumnNames() Returns an array of
String . | public String | getColumnNames(int index) Returns a
String which contains the column name set for the column or
null . | public String[] | getColumnSchemaNames() Returns an array of
String . | public String | getColumnSchemaNames(int index) Returns a
String which contains the schema name set for the column or
null . | public String[] | getColumnTableNames() Returns an array of
String . | public String | getColumnTableNames(int index) Returns a
String which contains the table name set for the column or
null . | public boolean[] | getInsertableColumns() Returns an array of boolean{/code>. | public boolean | getInsertableColumns(int index) Returns a boolean{/code> of true if the column should be inserted when
when adding rows or null . | public boolean | getPrintStatements() Returns the printStatements property. | public String | getSchemaName() Returns the schema in which the table referred to by the tableName property
resides. | public boolean[] | getUpdatableColumns() Returns an array of boolean{/code>. | public boolean | getUpdatableColumns(int index) Returns a boolean{/code> of true if the column should be updated when
when updating rows or null . | public boolean | isExecuted() | public void | removePropertyChangeListener(PropertyChangeListener listener) Remove a PropertyChangeListener from the listener list. | public void | removePropertyChangeListener(String propertyName, PropertyChangeListener listener) Remove a PropertyChangeListener for a specific property. | public void | setCatalogName(String catalogName) Sets the identifier for catalog of the table referred to in the tableName
property. | public void | setColumnCatalogNames(String[] columnCatalogNames) Set the columnCatalogNames property. | public void | setColumnCatalogNames(int index, String columnCatalogName) Set the columnCatalogNames property. | public void | setColumnNames(String[] columnNames) Set the columnNames property. | public void | setColumnNames(int index, String columnName) Set the columnNames property. | public void | setColumnSchemaNames(String[] columnSchemaNames) Set the columnSchemaNames property. | public void | setColumnSchemaNames(int index, String columnSchemaName) Set the columnSchemaNames property. | public void | setColumnTableNames(String[] columnTableNames) Set the columnTableNames property. | public void | setColumnTableNames(int index, String columnTableName) Set the columnTableNames property. | public void | setInsertableColumns(boolean[] insertableColumns) Set the insertableColumns property. | public void | setInsertableColumns(int index, boolean insertableColumn) Set the insertableColumns property. | public void | setPrintStatements(boolean printStatements) Sets the printStatements property.
If this property is true ,
SQL Insert , UPDATE and DELETE statements will
be written to System.out . | public void | setSchemaName(String schemaName) Sets the identifier for schema of the table referred to in the tableName
property. | public void | setUpdatableColumns(boolean[] updatableColumns) Set the updatableColumns property. | public void | setUpdatableColumns(int index, boolean updatableColumn) Set the updatableColumns property. |
addPropertyChangeListener | public void addPropertyChangeListener(PropertyChangeListener listener)(Code) | | Add a PropertyChangeListener to the listener list.
The listener is registered for all bound properties.
Parameters: listener - The PropertyChangeListener to be added |
addPropertyChangeListener | public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code) | | Add a PropertyChangeListener for a specific property. The listener
will be invoked only on a change of the specific property.
Parameters: propertyName - The name of the property to listen on. Parameters: listener - The PropertyChangeListener to be added |
getColumnCatalogNames | public String[] getColumnCatalogNames()(Code) | | Returns an array of
String . If setColumnCatalogNames was never called,
null is returned, else the value set when calling
setColumnCatalogNames{/code> is returned. See setColumnCatalogNames
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by
com.sun.sql.rowset.internal.CachedRowSetXWriter .
an array of String objects or null |
getColumnCatalogNames | public String getColumnCatalogNames(int index)(Code) | | Returns a
String which contains the catalog name set for the column or
null .
Note, the column is zero based whereas most jdbc calls are one based.
a String object or null throws: NullPointerException - if columnCatalogNames was never set. throws: ArrayIndexOutOfBoundsException - if index is >=columnCatalogName.length |
getColumnNames | public String[] getColumnNames()(Code) | | Returns an array of
String . If setColumnNames was never called,
null is returned, else the value set when calling
setColumnNames{/code> is returned. See setColumnNames
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by
com.sun.sql.rowset.internal.CachedRowSetXWriter .
an array of String objects or null |
getColumnSchemaNames | public String[] getColumnSchemaNames()(Code) | | Returns an array of
String . If setColumnSchemaNames was never called,
null is returned, else the value set when calling
setColumnSchemaNames{/code> is returned. See setColumnSchemaNames
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by
com.sun.sql.rowset.internal.CachedRowSetXWriter .
an array of String objects or null |
getColumnSchemaNames | public String getColumnSchemaNames(int index)(Code) | | Returns a
String which contains the schema name set for the column or
null .
Note, the column is zero based whereas most jdbc calls are one based.
a String object or null throws: NullPointerException - if columnSchemaNames was never set. throws: ArrayIndexOutOfBoundsException - if index is >=columnSchemaName.length |
getColumnTableNames | public String[] getColumnTableNames()(Code) | | Returns an array of
String . If setColumnTableNames was never called,
null is returned, else the value set when calling
setColumnTableNames{/code> is returned. See setColumnTableNames
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by
com.sun.sql.rowset.internal.CachedRowSetXWriter .
an array of String objects or null |
getColumnTableNames | public String getColumnTableNames(int index)(Code) | | Returns a
String which contains the table name set for the column or
null .
Note, the column is zero based whereas most jdbc calls are one based.
a String object or null throws: NullPointerException - if columnTableNames was never set. throws: ArrayIndexOutOfBoundsException - if index is >=columnTableName.length |
getInsertableColumns | public boolean[] getInsertableColumns()(Code) | | Returns an array of boolean{/code>. If setInsertableColumns was never called,
null is returned, else the value set when calling
setInsertableColumns{/code> is returned. See setInsertableColumns
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by
com.sun.sql.rowset.internal.CachedRowSetXWriter .
an array of boolean{/code> objects or null |
getInsertableColumns | public boolean getInsertableColumns(int index)(Code) | | Returns a boolean{/code> of true if the column should be inserted when
when adding rows or null .
Note, the column is zero based whereas most jdbc calls are one based.
a boolean/code> object or null throws: NullPointerException - if insertableColumns was never set. throws: ArrayIndexOutOfBoundsException - if index is >=insertableColumns.length |
getPrintStatements | public boolean getPrintStatements()(Code) | | Returns the printStatements property.
a boolean{/code> object which, if true, causes SQL statements to be written toSystem.out .Note: This method is called by com.sun.sql.rowset.internal.CachedRowSetXWriter. |
getUpdatableColumns | public boolean[] getUpdatableColumns()(Code) | | Returns an array of boolean{/code>. If setUpdatableColumns was never called,
null is returned, else the value set when calling
setUpdatebleColumns{/code> is returned. See setUpdatableColumns
for details.
Note, the column is zero based whereas most jdbc calls are one based.
Note: This method is called by
com.sun.sql.rowset.internal.CachedRowSetXWriter .
an array of boolean{/code> objects or null |
getUpdatableColumns | public boolean getUpdatableColumns(int index)(Code) | | Returns a boolean{/code> of true if the column should be updated when
when updating rows or null .
Note, the column is zero based whereas most jdbc calls are one based.
a boolean{/code> object or null throws: NullPointerException - if updatableColumns was never set. throws: ArrayIndexOutOfBoundsException - if index is >=updatableColumns.length |
isExecuted | public boolean isExecuted() throws SQLException(Code) | | Returns true if this rowset is in an executed state
a boolean true if the com.sun.sql.rowset.CachedRowSetXis in a state where navigation and getters and setters can be called on rowsreturned from the database (i.e., returns true if execute() or populate has been called. exception: SQLException - if a database access error occurs |
removePropertyChangeListener | public void removePropertyChangeListener(PropertyChangeListener listener)(Code) | | Remove a PropertyChangeListener from the listener list.
This removes a PropertyChangeListener that was registered
for all bound properties.
Parameters: listener - The PropertyChangeListener to be removed |
removePropertyChangeListener | public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code) | | Remove a PropertyChangeListener for a specific property.
Parameters: propertyName - The name of the property that was listened on. Parameters: listener - The PropertyChangeListener to be removed |
setColumnCatalogNames | public void setColumnCatalogNames(String[] columnCatalogNames)(Code) | | Set the columnCatalogNames property.
Parameters: columnCatalogNames - an array of String, one for each column, which containsthe name of catalog of the corresponding column (each element can also benull Note, the column is zero based whereas most jdbc calls are one based. |
setColumnCatalogNames | public void setColumnCatalogNames(int index, String columnCatalogName)(Code) | | Set the columnCatalogNames property.
Parameters: index - the index of the array to set (zero based) Parameters: columnCatalogName - the name of catalog for the column (can also be null throws: NullPointerException - if columnCatalogNames was never set. throws: ArrayIndexOutOfBoundsException - if index is >=columnCatalogName.length Note, the column is zero based whereas most jdbc calls are one based. |
setColumnNames | public void setColumnNames(String[] columnNames)(Code) | | Set the columnNames property.
Parameters: columnNames - an array of String, one for each column, which containsthe name of column (each element can also be null Note, the column is zero based whereas most jdbc calls are one based. |
setColumnNames | public void setColumnNames(int index, String columnName)(Code) | | Set the columnNames property.
Parameters: index - the index of the array to set (zero based) Parameters: columnName - for the column (can also be null throws: NullPointerException - if columnNames was never set. throws: ArrayIndexOutOfBoundsException - if index is >=columnName.length Note, the column is zero based whereas most jdbc calls are one based. |
setColumnSchemaNames | public void setColumnSchemaNames(String[] columnSchemaNames)(Code) | | Set the columnSchemaNames property.
Parameters: columnSchemaNames - an array of String, one for each column, which containsthe name of schema of the corresponding column (each element can also benull Note, the column is zero based whereas most jdbc calls are one based. |
setColumnSchemaNames | public void setColumnSchemaNames(int index, String columnSchemaName)(Code) | | Set the columnSchemaNames property.
Parameters: index - the index of the array to set (zero based) Parameters: columnSchemaName - the name of schema for the column (can also be null throws: NullPointerException - if columnSchemaNames was never set. throws: ArrayIndexOutOfBoundsException - if index is >=columnSchemaName.length Note, the column is zero based whereas most jdbc calls are one based. |
setColumnTableNames | public void setColumnTableNames(String[] columnTableNames)(Code) | | Set the columnTableNames property.
Parameters: columnTableNames - an array of String, one for each column, which containsthe name of table of the corresponding column (each element can also benull Note, the column is zero based whereas most jdbc calls are one based. |
setColumnTableNames | public void setColumnTableNames(int index, String columnTableName)(Code) | | Set the columnTableNames property.
Parameters: index - the index of the array to set (zero based) Parameters: columnTableName - the name of table for the column (can also be null throws: NullPointerException - if columnTableNames was never set. throws: ArrayIndexOutOfBoundsException - if index is >=columnTableName.length Note, the column is zero based whereas most jdbc calls are one based. |
setInsertableColumns | public void setInsertableColumns(boolean[] insertableColumns)(Code) | | Set the insertableColumns property.
Parameters: insertableColumns - an array of boolean one for each column, which containsa boolean indicating whether or not the column should be inserted when addingrows to the com.sun.sql.rowset.CachedRowSetXNote, the column is zero based whereas most jdbc calls are one based. |
setInsertableColumns | public void setInsertableColumns(int index, boolean insertableColumn)(Code) | | Set the insertableColumns property.
Parameters: index - the index of the array to set (zero based) Parameters: insertableColumn - true if column should be inserted for new rows throws: NullPointerException - if insertableColumns was never set. throws: ArrayIndexOutOfBoundsException - if index is >=insertableColumns.length Note, the column is zero based whereas most jdbc calls are one based. |
setPrintStatements | public void setPrintStatements(boolean printStatements)(Code) | | Sets the printStatements property.
If this property is true ,
SQL Insert , UPDATE and DELETE statements will
be written to System.out . This property is intended to be set when debugging
problems inserting, updating and deleting. With the information gained from examining the
output, it is intended that one can set the other advanced properties on the
com.sun.sql.rowset.CachedRowSetX to "fix" the SQL statements being generated. In this way,
some JDBC driver problems can be overcome.
Parameters: printStatements - a boolean{/code> object which determines whetherSQL Insert , UPDATE and DELETE statements arewritten to System.out |
setUpdatableColumns | public void setUpdatableColumns(boolean[] updatableColumns)(Code) | | Set the updatableColumns property.
Parameters: updatableColumns - an array of boolean , one for each column, which containsa boolean indicating whether or not the column should be updated when updatingrows to the com.sun.sql.rowset.CachedRowSetXNote, the column is zero based whereas most jdbc calls are one based. |
setUpdatableColumns | public void setUpdatableColumns(int index, boolean updatableColumn)(Code) | | Set the updatableColumns property.
Parameters: index - the index of the array to set (zero based) Parameters: updatableColumn - true if column should be updated when rows are updated throws: NullPointerException - if updatableColumns was never set. throws: ArrayIndexOutOfBoundsException - if index is >=updatableColumns.length Note, the column is zero based whereas most jdbc calls are one based. |
|
|