com.sas.storage.jdbc
Class JDBCToDataTableAdapter

com.sas.storage.jdbc.JDBCToDataTableAdapter
All Implemented Interfaces:
com.sas.collection.ContentsChangedSource, com.sas.ModelInterface, DataTableInterface, FormattedDataInterface, RowTemplateTableInterface, com.sas.table.StaticColumnInfoInterface, StaticColumnLabelInterface, StaticFormattedDataInterface, com.sas.table.StaticRowLabelInterface, StaticRowTemplateTableInterface, StaticTableInterface, TableInterface, com.sas.util.transforms.DisplayTransformInterface

public class JDBCToDataTableAdapter
implements DataTableInterface, com.sas.ModelInterface, com.sas.collection.ContentsChangedSource

The JDBCToDataTableAdapter allows JDBC data sources to be displayed in any viewer that requires a model of type com.sas.table.DataTableInterface, such as the com.sas.table.TableView.

The adapter requires a java.sql.Connection object and a query statement. They can be passed in on the constructor or set via methods. The setConnection() method will apply the connection object. The setQueryStatement() method will apply the SQL query statement. When non-null values for both connection and query statement have been applied, the adapter is initialized and ready to use.

The query statement must be a SQL query that is valid for the JDBC data source. This may include a blank statement, if valid.

If autoCommit is true when any setXXX method is used, an updateRow() method will be called upon the ResultSet so that the value(s) passed by the setXXX method are updated to the data source. If autoCommit is false, it is necessary to call the commitRow() method to commit changes to the data source.

This adapter works best with JDBC drivers that can create scrollable result sets. Table viewers usually need to read backwards to support scrolling the viewer. However, this adapter can support using scrolling viewers with forward-only result sets (ResultSet.TYPE_FORWARD_ONLY). That is accomplished by requerying the result set whenever there is a need to read a row before the current row. There is a performance penalty for this because the server must be requeried and the adapter re-initializes. If you want to turn off this feature, call setResultSetRequeryUsed(false).

Here an example of how the adapter can be created using the JdbcOdbc driver.

 Connection conn = null;
   try 
          {      
           Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );    
           conn = java.sql.DriverManager.getConnection("jdbc:odbc:Northwind");
           //create the query statement.
           String queryStatement ="select * from orders";       

           //create the Adapter
           JDBCToDataTableAdapter adapter = new JDBCToDataTableAdapter(conn, queryStatement);
          }
 

The adapter can be configured and used within a webAF project. Add a com.sas.storage.jdbc.JDBCConnection component to your project. Open the customizer and specify the values needed for your JDBC connection, including the driver name and URL. Now open the customizer for the adapter. Specify the value for JDBC Connection using the top combo box. The drop-down list will show all JDBC Connection objects that exist in your project. You can set the properties for query statement, column information used, autoCommit, and read-only, as well.

Since:
2.0

Field Summary
protected  com.sas.collection.ContentsChangedListenerList allContentsChangedListeners
          List of all the ContentsChangedListeners
protected  java.util.Hashtable defaultValues
          A Hashtable used to obtain default values for a column.
static int ERROR_CODE_END_OF_FILE
          An error code, used to signal that the end of file was reached when reading rows.
 
Fields inherited from class com.sas.storage.jdbc.JDBCAdapter
autoCommit, CLASS_NAME, columnInfoUsed, conn, designTime, displayTransform, forwardOnly, initialized, isRowCountKnown, LABEL, meta, NAME, printWarnings, queryRowCountDisabled, queryStatement, RB_KEY, readOnly, result, resultSetRequeryUsed, resultSetType, resultSetUsed, retrieveNumericTypesAsDouble, rowCount, rowCountQueryString, rowNumber, spcs, stmt, trimUsed
 
Fields inherited from interface com.sas.table.RowTemplateTableInterface
DEFAULT_INDEX
 
Constructor Summary
JDBCToDataTableAdapter()
          Default constructor called when the adapter is made in a webAF project.
JDBCToDataTableAdapter(java.sql.Connection conn, java.lang.String queryStatement)
          Constructor used to create an initialized adapter.
JDBCToDataTableAdapter(java.sql.ResultSet result)
          Constructor used to connect an adapter directly to a previously created ResultSet.
 
Method Summary
protected  boolean absolute(int index)
          For scrollable result sets, the absolute() method is called on the result set.
 void addColumn(int p0, java.lang.Class p1, java.lang.Object p2)
          This method is not supported.
 void addContentsChangedListener(com.sas.collection.ContentsChangedListener listener)
           
 void addRow(int index)
          This method requires a value of -1 for index.
 void addRow(int index, java.lang.Object[] values)
          This method requires a value of -1 for index.
 boolean attachView()
          Required by com.sas.ModelInterface.
 void commitRow()
          If autoCommit is false, this method calls updateRow on the result set.
 int countColumns(int maxCount)
          The maxCount parameter is ignored and the result of getColumnCount is returned.
 int countRows(int maxCount)
          Counts the number of rows when the underlying result set is not scrollable (TYPE_FORWARD_ONLY) and resultSetRequeryUsed is true.
 void deleteColumn(int p0)
          This method is not supported.
 void deleteRow(int row)
          Deletes the row at the given row number.
 void detachView()
          Required by com.sas.ModelInterface.
 void fireCellEvent(int row, int column)
          Fire a specific event for a model signaling that one cell has changed.
protected  void fireContentsChanged()
          Fire a default contents changed event.
protected  void fireContentsChanged(com.sas.collection.ContentsChangedEvent event)
          Send a ContentsChangedEvent to all the ContentsChangedListener objects in the listener list.
 void fireModelEvent()
          Fire a default event for a model signaling the some aspect of the model has changed.
 void fireModelEvent(java.util.EventObject event)
          Fire a specific event for a model signaling that some aspect of the model has changed.
 int getBufferBlocks()
          This method always returns 1.
 int getBufferSize()
          This returns the number of rows suggested to the JDBC driver as the number of rows to fetch from the database when more rows are needed for this result set object.
 java.lang.Object getCell(int row, int col)
          Returns value of a cell in the JDBC data type of the cell.
 java.lang.Class getCellClass(int row, int col)
          Returns the value of column class at the column identified by col.
 java.lang.Class[][] getCellClasses(int startRowIndex, int startColumnIndex, int rowCount, int columnCount)
          Returns the classes for a block of cells.
 java.lang.Object[][] getCells(int startRowIndex, int startColumnIndex, int rowCount, int columnCount)
          Returns values for a block of cells in the JDBC data types of the cells.
 java.lang.Object[] getColumn(int index)
          Returns the values of all the cells in a column.
 java.lang.Class getColumnClass(int index)
          Returns the class of a column.
 java.lang.Class[] getColumnClasses(int col, int columnCount)
          Returns the classes for a range of columns.
 int getColumnCount()
          Returns the number of columns in the result set.
 java.lang.Object getColumnDefaultValue(int index)
          Returns any default value set by setColumnDefaultValue.
 java.lang.Object[] getColumnDefaultValues(int index, int count)
          Returns any default values set by setColumnDefaultValues.
 int getColumnIndex(java.lang.String name)
          Returns the column index for a column name.
 java.lang.Object getColumnInfo(int index, java.lang.String columnInfoName)
          Returns the named information for a column.
 java.lang.String[] getColumnInfoNames()
          Returns NAME and LABEL in an array.
 java.lang.String getColumnInfoUsed()
          Returns the column information that is currently being used as the column label.
 java.lang.Object getColumnLabel(int index)
          If columnInfoUsed is "LABEL", gets the suggested column title provided by ResultSetMetaData object for the column at the given index.
 java.lang.Object[] getColumnLabels(int index, int count)
          If columnInfoUsed is "LABEL", gets the suggested column titles provided by ResultSetMetaData object for the column range.
 java.lang.String[] getDisplayedColumns()
          This method is not supported.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Manage properties in the webAF properties sheet.
 java.lang.String getFormattedCell(int rowIndex, int colIndex)
          Returns the formatted value of a cell.
 java.lang.String[][] getFormattedCells(int startRow, int startColumn, int rowCount, int columnCount)
          Returns the formatted values for a block of cells.
 java.lang.String[] getFormattedColumn(int col)
          Returns the formatted values of all the cells in a column.
 java.lang.String[] getFormattedRow(int row)
          Returns the formatted values of all the cells in a row.
 java.lang.Object[] getRow(int row)
          Returns the values of all the cells in a row.
 int getRowCount()
          Returns the number of rows in the result set.
 java.lang.Object getRowLabel(int row)
          Returns the row number passed in as a statement.
 java.lang.Object[] getRowLabels(int startIndex, int count)
          Returns the row number range as statements in an Object array.
 java.lang.String getWhere()
          Returns the queryStatement.
protected  void initDefaultValues()
          Initialize a hashtable for 1) storing column default values from setColumnDefaultValue, 2) getting column default values for getColumnDefaultValue.
 boolean isCellsModifiable()
          Indicates whether cells can be modified.
 boolean isColumnLabelsSupported()
          This method always returns true.
 boolean isColumnsDeletable()
          This method always returns false.
 boolean isColumnsExtendable()
          This method always returns false.
 boolean isColumnsInsertable()
          This method always returns false.
 boolean isColumnsLabelSupported()
          This method always returns false.
 boolean isColumnsRedefinable()
          This method always returns false.
 boolean isMultipleColumnUpdateSupported()
          This method always returns true.
 boolean isMultipleRowUpdateSupported()
          This method always returns true.
 boolean isRowLabelsSupported()
          This method always returns true.
 boolean isRowsDeletable()
          Returns the same value as the isReadOnly method.
 boolean isRowsExtendable()
          Returns the same value as the isReadOnly method.
 boolean isRowsInsertable()
          This method always returns false.
 boolean isRowsLabelSupported()
          This method always returns false.
 void refresh()
          Sets the initialized field to false and calls the init method.
 void removeContentsChangedListener(com.sas.collection.ContentsChangedListener listener)
           
 void setBufferBlocks(int p0)
          This method is not supported.
 void setBufferSize(int rows)
          Gives the JDBC driver a hint as to the number of rows to fetch from the database when more rows are needed for this ResultSet object.
 void setCell(int rowIndex, int columnIndex, java.lang.Object value)
          Updates value into the cell at rowIndex, columnIndex.
 void setCells(int startRowIndex, int startColumnIndex, int rowCount, int columnCount, java.lang.Object[][] values)
          Specifies the values for a block of cells.
 void setColumn(int columnIndex, java.lang.Object[] values)
          Specifies the values of all the cells in a column.
 void setColumnClass(int p0, java.lang.Class p1)
          This method is not supported.
 void setColumnDefaultValue(int index, java.lang.Object newValue)
          Sets the default value associated with a column.
 void setColumnInfoUsed(java.lang.String info)
          Sets the column information that is currently being used as the column label.
 void setDisplayedColumns(java.lang.String[] p0)
          This method is not supported.
 void setFormattedCell(int rowIndex, int columnIndex, java.lang.String value)
          Specifies the formatted value of a cell.
 void setFormattedCells(int startRowIndex, int startColumnIndex, int rowCount, int columnCount, java.lang.String[][] values)
          Specifies the formatted values for a block of cells.
 void setFormattedColumn(int index, java.lang.String[] values)
          Specifies the formatted values of all the cells in a column.
 void setFormattedRow(int index, java.lang.String[] values)
          Specifies the formatted values of all the cells in a row.
 void setRow(int rowIndex, java.lang.Object[] values)
          Specifies the values of all the cells in a row.
 void setWhere(java.lang.String whereString)
          Passes the whereString to setQueryStatement method.
protected  void updateCell(int col, java.lang.Object value)
          This method is called by public "setter" methods.
 void useBufferHints(com.sas.models.BufferHints p0)
          This method is not supported.
 
Methods inherited from class com.sas.storage.jdbc.JDBCAdapter
addPropertyChangeListener, addPropertyChangeListener, calculateRowCount, close, doAbsolute, doCountColumns, doUpdateCell, finalize, getAutoCommit, getConnection, getDisplayTransform, getModel, getPrintWarnings, getQueryStatement, getResultSetConcurrency, getResultSetRowCount, getResultSetType, getRowCountByCountFunction, getRowCountQueryString, init, initializeData, isQueryRowCountDisabled, isReadOnly, isResultSetRequeryUsed, isRetrieveNumericTypesAsDouble, isTrimUsed, printSQLWarning, putColumnInfoUsed, putValueAt, removePropertyChangeListener, removePropertyChangeListener, retrieveColumnClass, retrieveColumnCount, retrieveColumnIndex, retrieveColumnInfoUsed, retrieveColumnLabel, retrieveRawSASNumericValue, retrieveRawSASNumericValue, retrieveValueAt, retrieveValueAt, setAutoCommit, setConnection, setDisplayTransform, setModel, setPrintWarnings, setQueryRowCountDisabled, setQueryStatement, setReadOnly, setResultSetRequeryUsed, setResultSetType, setRetrieveNumericTypesAsDouble, setRowCountQueryString, setTrimUsed
 
Methods inherited from interface com.sas.table.DataTableInterface
close, isReadOnly, setReadOnly
 

Field Detail

ERROR_CODE_END_OF_FILE

public static final int ERROR_CODE_END_OF_FILE
An error code, used to signal that the end of file was reached when reading rows.

See Also:
Constant Field Values

defaultValues

protected java.util.Hashtable defaultValues
A Hashtable used to obtain default values for a column.


allContentsChangedListeners

protected transient com.sas.collection.ContentsChangedListenerList allContentsChangedListeners
List of all the ContentsChangedListeners

Constructor Detail

JDBCToDataTableAdapter

public JDBCToDataTableAdapter()
Default constructor called when the adapter is made in a webAF project.


JDBCToDataTableAdapter

public JDBCToDataTableAdapter(java.sql.ResultSet result)
Constructor used to connect an adapter directly to a previously created ResultSet.

Parameters:
result - ResultSet to use.

JDBCToDataTableAdapter

public JDBCToDataTableAdapter(java.sql.Connection conn,
                              java.lang.String queryStatement)
Constructor used to create an initialized adapter.

Parameters:
conn - A java.sql.Connection object.
queryStatement - A SQL query that is valid for the database represented by conn.
Method Detail

attachView

public boolean attachView()
Required by com.sas.ModelInterface. Always returns true.

Specified by:
attachView in interface com.sas.ModelInterface
Returns:
True.
See Also:
ModelInterface.detachView(), ViewInterface.attachModel(com.sas.ModelInterface)

detachView

public void detachView()
Required by com.sas.ModelInterface.

Specified by:
detachView in interface com.sas.ModelInterface
See Also:
ModelInterface.attachView(), ViewInterface.detachModel(com.sas.ModelInterface)

absolute

protected boolean absolute(int index)
                    throws com.sas.table.TableException
For scrollable result sets, the absolute() method is called on the result set. For result sets that are not scrollable (forward-only), this method can simulate scrolling backwards. If isResultSetRequeryUsed() returns true (the default), forward-only result sets will be requeried as needed to return to prior row(s). If it returns false, an attempt to move past the last row will throw a TableException and set its errorCode to ERROR_CODE_END_OF_FILE.

Parameters:
index - The row number to move to.
Returns:
True if it was possible to move to the given row index or false if the cursor is before the first row or after the last row.
Throws:
com.sas.table.TableException - If trying to scroll backward in a forward-only ResultSet and resultSetRequeryUsed = false, or if index is greater than the number of rows.

initDefaultValues

protected void initDefaultValues()
Initialize a hashtable for 1) storing column default values from setColumnDefaultValue, 2) getting column default values for getColumnDefaultValue.


refresh

public void refresh()
Sets the initialized field to false and calls the init method.

Specified by:
refresh in interface DataTableInterface
Overrides:
refresh in class JDBCAdapter

getColumnIndex

public int getColumnIndex(java.lang.String name)
                   throws java.lang.IllegalArgumentException,
                          com.sas.table.TableException
Returns the column index for a column name.

Specified by:
getColumnIndex in interface DataTableInterface
Parameters:
name - The column name.
Returns:
The column index.
Throws:
com.sas.table.TableException - If column name is not found.
java.lang.IllegalArgumentException - if the column is not in the data set.

getColumnInfoUsed

public java.lang.String getColumnInfoUsed()
Returns the column information that is currently being used as the column label. The method will return either NAME or LABEL if the field has been set.

Specified by:
getColumnInfoUsed in interface DataTableInterface
Returns:
The type of information used as the column header.
See Also:
DataTableInterface.setColumnInfoUsed(java.lang.String)

setColumnInfoUsed

public void setColumnInfoUsed(java.lang.String info)
                       throws com.sas.table.TableException
Sets the column information that is currently being used as the column label. Valid values are "name" and "label". They are not case-sensitive.

Specified by:
setColumnInfoUsed in interface DataTableInterface
Parameters:
info - The type of information to use in column labels.
Throws:
com.sas.table.TableException - If info is not a valid value.
See Also:
DataTableInterface.getColumnInfoUsed()

setWhere

public void setWhere(java.lang.String whereString)
Passes the whereString to setQueryStatement method. Like the queryStatement, the whereString must a SQL query valid for the JDBC data source.

Specified by:
setWhere in interface DataTableInterface
Parameters:
whereString - The SQL query to apply
See Also:
DataTableInterface.getWhere()

getWhere

public java.lang.String getWhere()
Returns the queryStatement.

Specified by:
getWhere in interface DataTableInterface
Returns:
The SQL query statement.
See Also:
DataTableInterface.getWhere()

getDisplayedColumns

public java.lang.String[] getDisplayedColumns()
This method is not supported.

Specified by:
getDisplayedColumns in interface DataTableInterface
Returns:
displayedColumns an array of column names which are displayed. The array will be in the order in which the columns are returned.

setDisplayedColumns

public void setDisplayedColumns(java.lang.String[] p0)
This method is not supported.

Specified by:
setDisplayedColumns in interface DataTableInterface
Parameters:
p0 - an array of column names to be displayed. The array should be in the order in which the columns should be returned.

setBufferSize

public void setBufferSize(int rows)
Gives the JDBC driver a hint as to the number of rows to fetch from the database when more rows are needed for this ResultSet object. Rows must be zero or more and not exceed the number of rows set as a limit for the result set object. This method calls setFetchSize on the result set.

Specified by:
setBufferSize in interface DataTableInterface
Parameters:
rows - The number of rows to fetch.
See Also:
DataTableInterface.setBufferBlocks(int), DataTableInterface.getBufferSize(), DataTableInterface.setBufferSize(int)

getBufferSize

public int getBufferSize()
This returns the number of rows suggested to the JDBC driver as the number of rows to fetch from the database when more rows are needed for this result set object. This method calls getFetchSize on the result set.

Specified by:
getBufferSize in interface DataTableInterface
Returns:
rows The number of rows suggested.
See Also:
DataTableInterface.setBufferSize(int), DataTableInterface.setBufferBlocks(int), DataTableInterface.getBufferBlocks()

setBufferBlocks

public void setBufferBlocks(int p0)
This method is not supported.

Specified by:
setBufferBlocks in interface DataTableInterface
Parameters:
p0 - Blocking factor. This number is multiplied by the bufferSize to determine the cache size, the number of rows to store locally in the client.
See Also:
DataTableInterface.getBufferBlocks(), DataTableInterface.setBufferSize(int), DataTableInterface.getBufferSize()

getBufferBlocks

public int getBufferBlocks()
This method always returns 1.

Specified by:
getBufferBlocks in interface DataTableInterface
Returns:
The number of buffer blocks.
See Also:
DataTableInterface.setBufferBlocks(int), DataTableInterface.setBufferSize(int), DataTableInterface.getBufferSize()

commitRow

public void commitRow()
If autoCommit is false, this method calls updateRow on the result set.

Specified by:
commitRow in interface DataTableInterface

useBufferHints

public void useBufferHints(com.sas.models.BufferHints p0)
This method is not supported.

Specified by:
useBufferHints in interface DataTableInterface

addColumn

public void addColumn(int p0,
                      java.lang.Class p1,
                      java.lang.Object p2)
               throws com.sas.table.TableException
This method is not supported.

Specified by:
addColumn in interface RowTemplateTableInterface
Parameters:
p0 - The one-based position at which to insert the column; columns already at or above that position will be shifted-up. If DEFAULT_INDEX is specified the position of the new column is implementation defined, but should be at the end if possible.
p1 - The class of the column's cells.
p2 - The default value for the column's cells.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

addRow

public void addRow(int index)
            throws com.sas.table.TableException
This method requires a value of -1 for index. That is the value of RowTemplateTableInterface.DEFAULT_INDEX. If -1 is passed in, addRow will insert a new blank row in the result set. Each cell in the row will have default values appropriate for the column class.

Specified by:
addRow in interface RowTemplateTableInterface
Parameters:
index - Must be -1.
Throws:
com.sas.table.TableException - Thrown if readOnly is true.
java.lang.IllegalStateException - Thrown if index is not -1.

addRow

public void addRow(int index,
                   java.lang.Object[] values)
            throws com.sas.table.TableException
This method requires a value of -1 for index. That is the value of RowTemplateTableInterface.DEFAULT_INDEX. If -1 is passed in, addRow will insert a new row in the result set. The number of values in the array must equal the number of columns in the result set.

Specified by:
addRow in interface RowTemplateTableInterface
Parameters:
index - Must be -1.
values - An Object array containing a value for each column.
Throws:
com.sas.table.TableException - Thrown if readOnly is true.
com.sas.table.TableException - Thrown if number of values in array is not equal to number of columns.
java.lang.IllegalStateException - Thrown if index is not -1.

deleteColumn

public void deleteColumn(int p0)
                  throws com.sas.table.TableException
This method is not supported.

Specified by:
deleteColumn in interface RowTemplateTableInterface
Parameters:
p0 - A one-based index that identifies the column.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

deleteRow

public void deleteRow(int row)
               throws com.sas.table.TableException
Deletes the row at the given row number.

Specified by:
deleteRow in interface RowTemplateTableInterface
Parameters:
row - The row number to delete.
Throws:
com.sas.table.TableException - Thrown if readOnly is true.
com.sas.table.TableException - Thrown if the result set's deleteRow throws a SQLException.

getColumnDefaultValue

public java.lang.Object getColumnDefaultValue(int index)
                                       throws com.sas.table.TableException
Returns any default value set by setColumnDefaultValue. Otherwise, the JDBC data type for the column at index is determined, then a suitable default value is returned. The column is identified by the given index. The default value is used as the value for cells in the column which are not assigned values of their own.

Specified by:
getColumnDefaultValue in interface RowTemplateTableInterface
Parameters:
index - A one-based index that identifies the column.
Returns:
The column's default value.
Throws:
com.sas.table.TableException - Provides a catch-all for all non-RuntimeExceptions.

getColumnDefaultValues

public java.lang.Object[] getColumnDefaultValues(int index,
                                                 int count)
                                          throws com.sas.table.TableException
Returns any default values set by setColumnDefaultValues. Otherwise, the JDBC data types for the columns from index to count are determined, then suitable default values are returned.

Specified by:
getColumnDefaultValues in interface RowTemplateTableInterface
Parameters:
index - A one-based index that identifies the starting column.
count - The number of columns in the column range.
Returns:
The column's default value.
Throws:
com.sas.table.TableException - Provides a catch-all for all non-RuntimeExceptions.

isColumnsDeletable

public boolean isColumnsDeletable()
                           throws com.sas.table.TableException
This method always returns false.

Specified by:
isColumnsDeletable in interface RowTemplateTableInterface
Returns:
True if columns can be deleted, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isColumnsExtendable

public boolean isColumnsExtendable()
                            throws com.sas.table.TableException
This method always returns false.

Specified by:
isColumnsExtendable in interface RowTemplateTableInterface
Returns:
True if new columns can be added, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isColumnsInsertable

public boolean isColumnsInsertable()
                            throws com.sas.table.TableException
This method always returns false.

Specified by:
isColumnsInsertable in interface RowTemplateTableInterface
Returns:
True if new columns can be inserted, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isColumnsRedefinable

public boolean isColumnsRedefinable()
                             throws com.sas.table.TableException
This method always returns false.

Specified by:
isColumnsRedefinable in interface RowTemplateTableInterface
Returns:
True if columns can be redefined, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isRowsDeletable

public boolean isRowsDeletable()
                        throws com.sas.table.TableException
Returns the same value as the isReadOnly method.

Specified by:
isRowsDeletable in interface RowTemplateTableInterface
Returns:
True if isReadOnly returns true.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isRowsExtendable

public boolean isRowsExtendable()
                         throws com.sas.table.TableException
Returns the same value as the isReadOnly method.

Specified by:
isRowsExtendable in interface RowTemplateTableInterface
Returns:
True if isReadOnly returns true.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isRowsInsertable

public boolean isRowsInsertable()
                         throws com.sas.table.TableException
This method always returns false.

Specified by:
isRowsInsertable in interface RowTemplateTableInterface
Returns:
True if new rows can be inserted, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

setColumnDefaultValue

public void setColumnDefaultValue(int index,
                                  java.lang.Object newValue)
                           throws com.sas.table.TableException
Sets the default value associated with a column. The column is identified by the given index. The default value is used as the value for cells in the column that are not assigned values of their own.

Specified by:
setColumnDefaultValue in interface RowTemplateTableInterface
Parameters:
index - A one-based index that identifies the column.
newValue - The new default value to associate with the column.
Throws:
com.sas.table.TableException - Provides a catch-all for all non-RuntimeExceptions.

setColumnClass

public void setColumnClass(int p0,
                           java.lang.Class p1)
                    throws com.sas.table.TableException
This method is not supported.

Specified by:
setColumnClass in interface RowTemplateTableInterface
Parameters:
p0 - A one-based index that identifies the column.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

getRowLabel

public java.lang.Object getRowLabel(int row)
                             throws com.sas.table.TableException
Returns the row number passed in as a statement. It never throws a TableException.

Specified by:
getRowLabel in interface com.sas.table.StaticRowLabelInterface
Parameters:
row - The row number as an int.
Returns:
The row number as a String object.
Throws:
com.sas.table.TableException

getRowLabels

public java.lang.Object[] getRowLabels(int startIndex,
                                       int count)
                                throws com.sas.table.TableException
Returns the row number range as statements in an Object array. It never throws a TableException.

Specified by:
getRowLabels in interface com.sas.table.StaticRowLabelInterface
Parameters:
startIndex - A one-based index that identifies the row.
count - The number of rows in the row range.
Returns:
A String array containing the row numbers as statements.
Throws:
com.sas.table.TableException

isRowLabelsSupported

public boolean isRowLabelsSupported()
                             throws com.sas.table.TableException
This method always returns true.

Specified by:
isRowLabelsSupported in interface com.sas.table.StaticRowLabelInterface
Throws:
com.sas.table.TableException

isRowsLabelSupported

public boolean isRowsLabelSupported()
                             throws com.sas.table.TableException
This method always returns false.

Specified by:
isRowsLabelSupported in interface com.sas.table.StaticRowLabelInterface
Throws:
com.sas.table.TableException

getColumnLabel

public java.lang.Object getColumnLabel(int index)
                                throws com.sas.table.TableException
If columnInfoUsed is "LABEL", gets the suggested column title provided by ResultSetMetaData object for the column at the given index. If columnInfoUsed is "NAME", gets the name of the column at the given index. If no label exists for a column, the name is returned.

Specified by:
getColumnLabel in interface StaticColumnLabelInterface
Parameters:
index - A one-based index that identifies the column.
Returns:
The label.
Throws:
com.sas.table.TableException - - Thrown if the ResultSetMetaData throws a SQLException.
See Also:
StaticColumnLabelInterface.isColumnLabelsSupported(), StaticColumnLabelInterface.isColumnsLabelSupported()

getColumnLabels

public java.lang.Object[] getColumnLabels(int index,
                                          int count)
                                   throws com.sas.table.TableException
If columnInfoUsed is "LABEL", gets the suggested column titles provided by ResultSetMetaData object for the column range. If columnInfoUsed is "NAME", gets the names of the columns in the given range. If no label exists for a column, the name is returned.

Specified by:
getColumnLabels in interface StaticColumnLabelInterface
Parameters:
index - A one-based index that identifies the column.
count - The number of columns in the column range.
Returns:
An Object array of the label statements.
Throws:
com.sas.table.TableException - - Thrown if the ResultSetMetaData throws a SQLException.
See Also:
StaticTableInterface.getColumnCount(), StaticColumnLabelInterface.isColumnLabelsSupported()

isColumnLabelsSupported

public boolean isColumnLabelsSupported()
                                throws com.sas.table.TableException
This method always returns true.

Specified by:
isColumnLabelsSupported in interface StaticColumnLabelInterface
Returns:
true if labels are available, and false otherwise.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).

isColumnsLabelSupported

public boolean isColumnsLabelSupported()
                                throws com.sas.table.TableException
This method always returns false.

Specified by:
isColumnsLabelSupported in interface StaticColumnLabelInterface
Returns:
true if a column labels label is supported, and false otherwise.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
See Also:
StaticColumnLabelInterface.getColumnLabel(int)

setFormattedCell

public void setFormattedCell(int rowIndex,
                             int columnIndex,
                             java.lang.String value)
                      throws com.sas.table.TableException
Specifies the formatted value of a cell. The cell is identified by the given row and column indices.

Specified by:
setFormattedCell in interface FormattedDataInterface
Parameters:
rowIndex - A one-based index that identifies the cell's row.
columnIndex - A one-based index that identifies the cell's column.
value - The cell's new formatted value.
Throws:
com.sas.table.TableException - Thrown if the operation can not be completed (e.g. i/o-failure).
See Also:
FormattedDataInterface.setFormattedCells(int, int, int, int, java.lang.String[][]), FormattedDataInterface.setFormattedColumn(int, java.lang.String[]), FormattedDataInterface.setFormattedRow(int, java.lang.String[])

setFormattedCells

public void setFormattedCells(int startRowIndex,
                              int startColumnIndex,
                              int rowCount,
                              int columnCount,
                              java.lang.String[][] values)
                       throws com.sas.table.TableException
Specifies the formatted values for a block of cells. The block is identified by the intersection of a range of rows with a range of columns. startRowIndex and rowCount define the start and extent of the row range while startColumnIndex and columnCount define the column range. The set of formatted values is specified as a two-dimensional array, new Object[rowCount][colCount], with values[0][0] containing the value of the cell at (startRowIndex, startColumnIndex).

Specified by:
setFormattedCells in interface FormattedDataInterface
Parameters:
startRowIndex - A one-based index that identifies the start of the row range.
startColumnIndex - A one-based index that identifies the start of the column range.
rowCount - The number of rows in the row range.
columnCount - The number of columns in the column range.
values - - The new formatted values for each cell in the block.
Throws:
com.sas.table.TableException - Thrown if the operation can not be completed (e.g. i/o-failure).
See Also:
FormattedDataInterface.setFormattedCell(int, int, java.lang.String)

setFormattedColumn

public void setFormattedColumn(int index,
                               java.lang.String[] values)
                        throws com.sas.table.TableException
Specifies the formatted values of all the cells in a column. If autoCommit is true, this method updates the rows for the column at index using the values in the String array. If autoCommit is false, the updates will be lost. If commitRow is called, only the value for the last row will be committed to the data source. The set of formatted values is specified as an array with each element of the array corresponding to a cell in the column.

Specified by:
setFormattedColumn in interface FormattedDataInterface
Parameters:
index - A one-based index that identifies the column.
values - The new formatted values for each cell in the column.
Throws:
com.sas.table.TableException - Thrown if the operation cannot be completed (e.g. i/o-failure).
See Also:
FormattedDataInterface.setFormattedCell(int, int, java.lang.String)

setFormattedRow

public void setFormattedRow(int index,
                            java.lang.String[] values)
                     throws com.sas.table.TableException
Specifies the formatted values of all the cells in a row. If autoCommit is true, this method updates the rows for the column at index using the values in the String array. If autoCommit is false, the updates will be lost unless commitRow is called.

The row is identified by the given index. The set of formatted values is specified as an array with each element of the array corresponding to a cell in the row.

Specified by:
setFormattedRow in interface FormattedDataInterface
Parameters:
index - A one-based index that identifies the row.
values - The new formatted values for each cell in the row.
Throws:
com.sas.table.TableException - Thrown if the operation cannot be completed (e.g. i/o-failure).
See Also:
FormattedDataInterface.setFormattedCell(int, int, java.lang.String)

getColumnInfoNames

public java.lang.String[] getColumnInfoNames()
                                      throws com.sas.table.TableException
Returns NAME and LABEL in an array. It never throws the TableException.

Specified by:
getColumnInfoNames in interface com.sas.table.StaticColumnInfoInterface
Overrides:
getColumnInfoNames in class JDBCAdapter
Returns:
an array of strings of the type of information the columns can be queried for
Throws:
com.sas.table.TableException
See Also:
StaticColumnInfoInterface

getColumnInfo

public java.lang.Object getColumnInfo(int index,
                                      java.lang.String columnInfoName)
                               throws com.sas.table.TableException
Returns the named information for a column. The column is identified by the given index.

Specified by:
getColumnInfo in interface com.sas.table.StaticColumnInfoInterface
Overrides:
getColumnInfo in class JDBCAdapter
Parameters:
index - A one-based index that identifies the column.
columnInfoName - - The name of the information to return for the column.
Returns:
The specified column's information.
Throws:
com.sas.table.TableException - Provides a catch-all for all non-RuntimeExceptions.
See Also:
JDBCAdapter.getColumnInfoNames(), StaticColumnInfoInterface

getColumnClass

public java.lang.Class getColumnClass(int index)
                               throws com.sas.table.TableException
Returns the class of a column. The column is identified by the given index.

Specified by:
getColumnClass in interface StaticRowTemplateTableInterface
Parameters:
index - - A one-based index that identifies the column.
Returns:
The specified column's class.
Throws:
com.sas.table.TableException - Thrown if ResultSetMetaData throws a SQLException.

getColumnClasses

public java.lang.Class[] getColumnClasses(int col,
                                          int columnCount)
                                   throws com.sas.table.TableException
Returns the classes for a range of columns. The range of columns is identified by the given index which serves to identify a starting column and by the given column count which defines the extent of the range. The set of classes is returned as an array with each element of the array corresponding to a column in the range. The class of columns that do not contain cells of a single class should be expressed as null.

Specified by:
getColumnClasses in interface StaticRowTemplateTableInterface
Parameters:
startIndex - A one-based index which identifies the start of the range.
count - The number of classes to return; defines the extent of the range.
Returns:
The specified columns' classes.
Throws:
com.sas.table.TableException - Provides a catch-all for all non-RuntimeExceptions.

isCellsModifiable

public boolean isCellsModifiable()
Indicates whether cells can be modified.

Specified by:
isCellsModifiable in interface TableInterface
Returns:
true if cells can be modified, and false otherwise.

isMultipleRowUpdateSupported

public boolean isMultipleRowUpdateSupported()
This method always returns true.

Specified by:
isMultipleRowUpdateSupported in interface TableInterface
Returns:
true if multiple rows can be simultaneously updated, and false otherwise.

isMultipleColumnUpdateSupported

public boolean isMultipleColumnUpdateSupported()
This method always returns true.

Specified by:
isMultipleColumnUpdateSupported in interface TableInterface
Returns:
true if multiple columns can be simultaneously updated, and false otherwise.

setCell

public void setCell(int rowIndex,
                    int columnIndex,
                    java.lang.Object value)
             throws com.sas.table.TableException
Updates value into the cell at rowIndex, columnIndex. If autoCommit is true, it also updates the row in the result set. If autoCommit is false, use commitRow to update the row.

Specified by:
setCell in interface TableInterface
Parameters:
rowIndex - A one-based index that identifies the cell's row.
columnIndex - A one-based index that identifies the cell's column.
value - The cell's new value.
Throws:
com.sas.table.TableException - Thrown if the operation cannot be completed (e.g. read-only).
See Also:
TableInterface.setCells(int, int, int, int, java.lang.Object[][]), TableInterface.setColumn(int, java.lang.Object[]), TableInterface.setRow(int, java.lang.Object[])

setCells

public void setCells(int startRowIndex,
                     int startColumnIndex,
                     int rowCount,
                     int columnCount,
                     java.lang.Object[][] values)
              throws com.sas.table.TableException
Specifies the values for a block of cells. The block is identified by the intersection of a range of rows with a range of columns. startRowIndex and rowCount define the start and extent of the row range while startColumnIndex and columnCount define the column range. The set of values is specified as a two-dimensional array, new Object[rowCount][colCount], with values[0][0] containing the value of the cell at (startRowIndex, startColumnIndex). Usually, the implementation will require that the class of each new value match what's returned by getCellClassfor the corresponding cell.

Because the range of cells may span multiple rows, autoCommit is ignored. Even if autoCommit is false, all rows will be updated.

Specified by:
setCells in interface TableInterface
Parameters:
startRowIndex - A one-based index that identifies the start of the row range.
startColumnIndex - - A one-based index that identifies the start of the column range.
rowCount - - The number of rows in the row range.
columnCount - - The number of columns in the column range.
values - - The new values for each cell in the block.
Throws:
com.sas.table.TableException - Thrown if the operation cannot be completed (e.g. read-only).
See Also:
TableInterface.setCell(int, int, java.lang.Object)

setColumn

public void setColumn(int columnIndex,
                      java.lang.Object[] values)
               throws com.sas.table.TableException
Specifies the values of all the cells in a column. The column is identified by the given index. The set of values is specified as an array with each element of the array corresponding to a cell in the column. Usually, the implementation will require that the class of each new value match what is returned by getColumnClass.

Because a column may span multiple rows, autoCommit is ignored. Even if autoCommit is false, all rows will be updated.

Specified by:
setColumn in interface TableInterface
Parameters:
columnIndex - A one-based index that identifies the column.
values - The new values for each cell in the column.
Throws:
com.sas.table.TableException - Thrown if any JDBC methods throw a SQLException or if isReadOnly returns true.
See Also:
TableInterface.setCell(int, int, java.lang.Object)

setRow

public void setRow(int rowIndex,
                   java.lang.Object[] values)
            throws com.sas.table.TableException
Specifies the values of all the cells in a row. The row is identified by the given index. The set of values is specified as an array with each element of the array corresponding to a cell in the row. Usually, the implementation will require that the class of each new value match what is returned by getColumnClass. If autoCommit is true, the updateRow method is called on the result set to commit changes to the data source. Otherwise, it will be necessary to call commitRow.

Specified by:
setRow in interface TableInterface
Parameters:
rowIndex - A one-based index that identifies the row.
values - The new values for each cell in the row.
Throws:
com.sas.table.TableException - Thrown if any JDBC methods throw a SQLException or if isReadOnly returns true.
See Also:
TableInterface.setCell(int, int, java.lang.Object)

countColumns

public int countColumns(int maxCount)
                 throws com.sas.table.TableException
The maxCount parameter is ignored and the result of getColumnCount is returned.

Specified by:
countColumns in interface StaticTableInterface
Parameters:
maxCount - Maximum number of columns to read, or 0 to read indefinitely. Implementations where the number of columns is always known should ignore this parameter. In cases where the total number of columns is unknown, but the number known so far is greater than maxCount should return the larger known number. Thus maxCount is only used as a limiting factor when the implementation has to actually do computation (e.g. fetch observations).
Returns:
The number of columns.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions are thrown.
See Also:
StaticTableInterface.getColumnCount(), StaticTableInterfaceSupport.countColumns(com.sas.table.StaticTableInterface, int)

countRows

public int countRows(int maxCount)
              throws com.sas.table.TableException
Counts the number of rows when the underlying result set is not scrollable (TYPE_FORWARD_ONLY) and resultSetRequeryUsed is true. Otherwise, the result of getRowCount() is returned. The maxCount parameter is ignored.

Specified by:
countRows in interface StaticTableInterface
Parameters:
maxCount - Any integer.
Returns:
The number of rows in the result set or -1.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions are thrown.
See Also:
StaticTableInterface.getRowCount(), StaticTableInterfaceSupport.countRows(com.sas.table.StaticTableInterface, int)

getCell

public java.lang.Object getCell(int row,
                                int col)
                         throws com.sas.table.TableException
Returns value of a cell in the JDBC data type of the cell. It calls the ResultSet getXXX method recommended in the JDBC API for that data type. The cell is identified by the given row and column indices.

Specified by:
getCell in interface StaticTableInterface
Parameters:
row - A one-based index that identifies the cell's row.
col - A one-based index that identifies the cell's column.
Returns:
The specified cell's value.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions are thrown.
See Also:
StaticTableInterface.getCells(int, int, int, int), StaticTableInterface.getColumn(int), StaticTableInterface.getRow(int)

getCells

public java.lang.Object[][] getCells(int startRowIndex,
                                     int startColumnIndex,
                                     int rowCount,
                                     int columnCount)
                              throws com.sas.table.TableException
Returns values for a block of cells in the JDBC data types of the cells. It calls the ResultSet getXXX method recommended in the JDBC API for that data type. The block is identified by the intersection of a range of rows with a range of columns. startRowIndex and rowCount define the start and extent of the row range while startColumnIndex and columnCount define the column range. The set of values is returned as a two-dimensional array, new Object[rowCount][colCount], with values[0][0] containing the value of the cell at (startRowIndex, startColumnIndex).

Specified by:
getCells in interface StaticTableInterface
Parameters:
startRowIndex - A one-based index that identifies the start of the row range.
startColumnIndex - A one-based index that identifies the start of the column range.
rowCount - The number of rows in the row range.
columnCount - The number of columns in the column range.
Returns:
The specified cell's value.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions are thrown.
See Also:
StaticTableInterface.getCell(int, int), StaticTableInterfaceSupport.getCells(com.sas.table.StaticTableInterface, int, int, int, int)

getCellClass

public java.lang.Class getCellClass(int row,
                                    int col)
                             throws com.sas.table.TableException
Returns the value of column class at the column identified by col. The value for row is ignored.

Specified by:
getCellClass in interface StaticTableInterface
Parameters:
row - Any integer.
col - A one-based index that identifies the cell's column.
Returns:
The cell's column class name.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions thrown.
See Also:
StaticTableInterface.getCellClasses(int, int, int, int)

getCellClasses

public java.lang.Class[][] getCellClasses(int startRowIndex,
                                          int startColumnIndex,
                                          int rowCount,
                                          int columnCount)
                                   throws com.sas.table.TableException
Returns the classes for a block of cells. The block is identified by the intersection of a range of rows with a range of columns. startRowIndex and rowCount define the start and extent of the row range while startColumnIndex and columnCount define the column range. The set of classes is returned as a two-dimensional array, new Class[rowCount][colCount], with clases[0][0] containing the class of the cell at (startRowIndex, startColumnIndex). The classes will be identical in all rows of a column.

Specified by:
getCellClasses in interface StaticTableInterface
Parameters:
startRowIndex - A one-based index that identifies the start of the row range.
startColumnIndex - A one-based index that identifies the start of the column range.
rowCount - The number of rows in the row range.
columnCount - The number of columns in the column range.
Returns:
The specified cells' classes.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions thrown.
See Also:
StaticTableInterface.getCellClass(int, int), StaticTableInterfaceSupport.getCellClasses(com.sas.table.StaticTableInterface, int, int, int, int)

getColumn

public java.lang.Object[] getColumn(int index)
                             throws com.sas.table.TableException
Returns the values of all the cells in a column. The column is identified by the given index. The set of values is returned as an array with each element of the array corresponding to a cell in the column.

Specified by:
getColumn in interface StaticTableInterface
Parameters:
index - - A one-based index that identifies the column.
Returns:
The values of the specified column's cells.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions thrown.
See Also:
StaticTableInterface.getCell(int, int), StaticTableInterfaceSupport.getColumn(com.sas.table.StaticTableInterface, int)

getColumnCount

public int getColumnCount()
                   throws com.sas.table.TableException
Returns the number of columns in the result set.

Specified by:
getColumnCount in interface StaticTableInterface
Returns:
The number of columns.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions are thrown.
See Also:
StaticTableInterface.countColumns(int)

getRow

public java.lang.Object[] getRow(int row)
                          throws com.sas.table.TableException
Returns the values of all the cells in a row. The row is identified by the given index. The set of values is returned as an array with each element of the array corresponding to a cell in the row.

Specified by:
getRow in interface StaticTableInterface
Parameters:
row - A one-based index that identifies the row.
Returns:
The values of the specified row's cells.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
See Also:
StaticTableInterface.getCell(int, int), StaticTableInterfaceSupport.getRow(com.sas.table.StaticTableInterface, int)

getRowCount

public int getRowCount()
                throws com.sas.table.TableException
Returns the number of rows in the result set. If the number of rows is unknown or there are no rows, -1 is returned. This method requires a scrollable result set. If the result set is ResultSet.TYPE_FORWARD_ONLY, this method returns -1.

Specified by:
getRowCount in interface StaticTableInterface
Returns:
The number or rows or -1.
Throws:
com.sas.table.TableException - Thrown if any SQLExceptions are thrown.
See Also:
StaticTableInterface.countRows(int)

getFormattedCell

public java.lang.String getFormattedCell(int rowIndex,
                                         int colIndex)
                                  throws com.sas.table.TableException
Description copied from interface: StaticFormattedDataInterface
Returns the formatted value of a cell. The cell is identified by the given row and column indices.

Specified by:
getFormattedCell in interface StaticFormattedDataInterface
Parameters:
rowIndex - A one-based index that identifies the cell's row.
colIndex - A one-based index that identifies the cell's column.
Returns:
The specified cell's formatted value.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
See Also:
StaticFormattedDataInterface.getFormattedCell(int, int)

getFormattedCells

public java.lang.String[][] getFormattedCells(int startRow,
                                              int startColumn,
                                              int rowCount,
                                              int columnCount)
                                       throws com.sas.table.TableException
Description copied from interface: StaticFormattedDataInterface
Returns the formatted values for a block of cells. The block is identified by the intersection of a range of rows with a range of columns. startRowIndex and rowCount define the start and extent of the row range while startColumnIndex and columnCount define the column range. The set of values is returned as a two-dimensional array, new Object[rowCount][colCount], with values[0][0] containing the formatted value of the cell at (startRowIndex, startColumnIndex).

Specified by:
getFormattedCells in interface StaticFormattedDataInterface
Parameters:
startRow - A one-based index that identifies the start of the row range.
startColumn - A one-based index that identifies the start of the column range.
rowCount - The number of rows in the row range.
columnCount - The number of columns in the column range.
Returns:
The specified cells' values.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
See Also:
StaticFormattedDataInterface.getFormattedCells(int, int, int, int)

getFormattedColumn

public java.lang.String[] getFormattedColumn(int col)
                                      throws com.sas.table.TableException
Description copied from interface: StaticFormattedDataInterface
Returns the formatted values of all the cells in a column. The column is identified by the given index. The set of values is returned as an array with each element of the array corresponding to a cell in the column.

Specified by:
getFormattedColumn in interface StaticFormattedDataInterface
Parameters:
col - A one-based index that identifies the column.
Returns:
The values of the specified column's cells.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
See Also:
StaticFormattedDataInterface.getFormattedColumn(int)

getFormattedRow

public java.lang.String[] getFormattedRow(int row)
                                   throws com.sas.table.TableException
Description copied from interface: StaticFormattedDataInterface
Returns the formatted values of all the cells in a row. The row is identified by the given index. The set of values is returned as an array with each element of the array corresponding to a cell in the row.

Specified by:
getFormattedRow in interface StaticFormattedDataInterface
Parameters:
row - A one-based index that identifies the row.
Returns:
The values of the specified row's cells.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
See Also:
StaticFormattedDataInterface.getFormattedRow(int)

updateCell

protected void updateCell(int col,
                          java.lang.Object value)
                   throws com.sas.table.TableException
This method is called by public "setter" methods. It obtains the column's JDBC type and then calls the correct JDBC updateXXX method. It takes the column number and a value to update into the cell. Value will be a String, if being called from a viewer via setFormattedCell(), etc. It must be possible to convert the Object into the correct type required by the updateXXX method.

Parameters:
the - one-based column number
the - value to be updated into the cell
Throws:
com.sas.table.TableException - if a JDBC method throws a SQLException.
java.lang.NumberFormatException - if numeric conversion fails

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Manage properties in the webAF properties sheet.


addContentsChangedListener

public void addContentsChangedListener(com.sas.collection.ContentsChangedListener listener)
Specified by:
addContentsChangedListener in interface com.sas.collection.ContentsChangedSource
See Also:
ContentsChangedSource.addContentsChangedListener(com.sas.collection.ContentsChangedListener)

removeContentsChangedListener

public void removeContentsChangedListener(com.sas.collection.ContentsChangedListener listener)
Specified by:
removeContentsChangedListener in interface com.sas.collection.ContentsChangedSource
See Also:
ContentsChangedSource.removeContentsChangedListener(com.sas.collection.ContentsChangedListener)

fireModelEvent

public void fireModelEvent(java.util.EventObject event)
Fire a specific event for a model signaling that some aspect of the model has changed. Subclasses must override this method to fire specific events for their model.

Specified by:
fireModelEvent in class JDBCAdapter
Parameters:
event - Event that must be cast that should be fired

fireContentsChanged

protected void fireContentsChanged(com.sas.collection.ContentsChangedEvent event)
Send a ContentsChangedEvent to all the ContentsChangedListener objects in the listener list. The listener list is copied first, so the event is sent only to each item which is in the list at the time of this copy, even if adds or removes are performed after the send has started. Also sends the ContentsChangedEvent, which extends PropertyChangeEvent, to all registered propertyChangeListeners, if there are any.

Parameters:
the - event to send
See Also:
addContentsChangedListener(com.sas.collection.ContentsChangedListener), removeContentsChangedListener(com.sas.collection.ContentsChangedListener)

fireCellEvent

public void fireCellEvent(int row,
                          int column)
Fire a specific event for a model signaling that one cell has changed. Subclasses must override this method to fire specific events for their model.

Specified by:
fireCellEvent in class JDBCAdapter
Parameters:
row - row number of the cell that has been modified
column - column number of the cell that has been modified

fireModelEvent

public void fireModelEvent()
Fire a default event for a model signaling the some aspect of the model has changed. Subclasses must override this method to fire a default events for their model.

Specified by:
fireModelEvent in class JDBCAdapter

fireContentsChanged

protected void fireContentsChanged()
Fire a default contents changed event. A ContentsChangedEvent will be constructed with this as the source and fireContentsChanged will be called.

See Also:
fireContentsChanged(com.sas.collection.ContentsChangedEvent)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.