Compiere 3.1

org.compiere.util
Class CCachedRowSet

java.lang.Object
  extended by javax.sql.rowset.BaseRowSet
      extended by org.compiere.util.CachedRowSetImpl
          extended by org.compiere.util.CCachedRowSet
All Implemented Interfaces:
Serializable, Cloneable, ResultSet, Wrapper, RowSet, CachedRowSet, Joinable, RowSetInternal

public class CCachedRowSet
extends CachedRowSetImpl
implements CachedRowSet

Compiere Cached Row Set Implementation

Version:
$Id: CCachedRowSet.java,v 1.6 2006/07/30 00:54:36 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.sql.rowset.BaseRowSet
ASCII_STREAM_PARAM, asciiStream, BINARY_STREAM_PARAM, binaryStream, charStream, UNICODE_STREAM_PARAM, unicodeStream
 
Fields inherited from interface javax.sql.rowset.CachedRowSet
COMMIT_ON_ACCEPT_CHANGES
 
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
 
Method Summary
static CCachedRowSet get()
          Get Cached Row Set.
static RowSet getRowSet(ResultSet rs)
          Get Cached Row Set.
static RowSet getRowSet(ResultSet rs, CompiereDatabase db)
          Get Cached Row Set.
static RowSet getRowSet(String sql)
          Get Row Set.
static RowSet getRowSet(String sql, Connection conn, CompiereDatabase db)
          Get and Execute Row Set.
static void main(String[] args)
          Test
 Collection<?> toCollection()
          To Collection
 Collection<?> toCollection(int column)
          To Collection
 Collection<?> toCollection(String column)
          To Collection
 
Methods inherited from class org.compiere.util.CachedRowSetImpl
absolute, acceptChanges, acceptChanges, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, clone, close, columnUpdated, columnUpdated, commit, createCopy, createCopyNoConstraints, createCopySchema, createShared, deleteRow, execute, execute, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConnection, getCurrentRow, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getHoldability, getInt, getInt, getKeyColumns, getLong, getLong, getMatchColumnIndexes, getMatchColumnNames, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getOriginal, getOriginalRow, getPageSize, getRef, getRef, getRow, getRowId, getRowId, getRowSetWarnings, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getSyncProvider, getTableName, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, internalFirst, internalLast, internalNext, internalPrevious, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isWrapperFor, last, moveToCurrentRow, moveToInsertRow, next, nextPage, populate, populate, previous, previousPage, refreshRow, relative, release, removeCurrentRow, restoreOriginal, rollback, rollback, rowDeleted, rowInserted, rowSetPopulated, rowUpdated, setAsciiStream, setAsciiStream, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBlob, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setClob, setClob, setCommand, setDate, setDate, setKeyColumns, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, setMetaData, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNClob, setNClob, setNClob, setNString, setNString, setObject, setObject, setObject, setOriginal, setOriginalRow, setPageSize, setRowId, setRowId, setRowInserted, setSQLXML, setSQLXML, setSyncProvider, setTableName, setTime, setTime, setTimestamp, setURL, size, undoDelete, undoInsert, undoUpdate, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 
Methods inherited from class javax.sql.rowset.BaseRowSet
addRowSetListener, clearParameters, getCommand, getConcurrency, getDataSourceName, getEscapeProcessing, getFetchDirection, getFetchSize, getMaxFieldSize, getMaxRows, getParams, getPassword, getQueryTimeout, getShowDeleted, getTransactionIsolation, getType, getTypeMap, getUrl, getUsername, initParams, isReadOnly, notifyCursorMoved, notifyRowChanged, notifyRowSetChanged, removeRowSetListener, setArray, setAsciiStream, setBigDecimal, setBigDecimal, setBinaryStream, setBinaryStream, setBlob, setBlob, setBoolean, setBoolean, setByte, setByte, setBytes, setBytes, setCharacterStream, setCharacterStream, setClob, setConcurrency, setDataSourceName, setDate, setDate, setDouble, setDouble, setEscapeProcessing, setFetchDirection, setFetchSize, setFloat, setFloat, setInt, setInt, setLong, setLong, setMaxFieldSize, setMaxRows, setNull, setNull, setNull, setNull, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setRef, setShort, setShort, setShowDeleted, setString, setString, setTime, setTime, setTimestamp, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setUnicodeStream, setUrl, setUsername
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.rowset.CachedRowSet
acceptChanges, acceptChanges, columnUpdated, columnUpdated, commit, createCopy, createCopyNoConstraints, createCopySchema, createShared, execute, getKeyColumns, getOriginal, getOriginalRow, getPageSize, getRowSetWarnings, getShowDeleted, getSyncProvider, getTableName, nextPage, populate, populate, previousPage, release, restoreOriginal, rollback, rollback, rowSetPopulated, setKeyColumns, setMetaData, setOriginalRow, setPageSize, setShowDeleted, setSyncProvider, setTableName, size, undoDelete, undoInsert, undoUpdate
 
Methods inherited from interface javax.sql.RowSet
addRowSetListener, clearParameters, execute, getCommand, getDataSourceName, getEscapeProcessing, getMaxFieldSize, getMaxRows, getPassword, getQueryTimeout, getTransactionIsolation, getTypeMap, getUrl, getUsername, isReadOnly, removeRowSetListener, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBlob, setBlob, setBlob, setBoolean, setBoolean, setByte, setByte, setBytes, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setClob, setClob, setClob, setCommand, setConcurrency, setDataSourceName, setDate, setDate, setDate, setDate, setDouble, setDouble, setEscapeProcessing, setFloat, setFloat, setInt, setInt, setLong, setLong, setMaxFieldSize, setMaxRows, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNClob, setNClob, setNClob, setNString, setNString, setNull, setNull, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setObject, setPassword, setQueryTimeout, setReadOnly, setRef, setRowId, setRowId, setShort, setShort, setSQLXML, setSQLXML, setString, setString, setTime, setTime, setTime, setTime, setTimestamp, setTimestamp, setTimestamp, setTimestamp, setTransactionIsolation, setType, setTypeMap, setURL, setUrl, setUsername
 
Methods inherited from interface java.sql.ResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 
Methods inherited from interface javax.sql.rowset.Joinable
getMatchColumnIndexes, getMatchColumnNames, setMatchColumn, setMatchColumn, setMatchColumn, setMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn, unsetMatchColumn
 
Methods inherited from interface javax.sql.RowSetInternal
getParams
 

Method Detail

get

public static CCachedRowSet get()
                         throws SQLException
Get Cached Row Set. Required due to Java Sun bug 393865

Returns:
Cached Row Set
Throws:
SQLException

getRowSet

public static RowSet getRowSet(String sql)
                        throws SQLException
Get Row Set. Read-Only, Scroll Insensitive Need to set parameters and call execute(Commection)

Parameters:
sql - sql
Returns:
row set
Throws:
SQLException

getRowSet

public static RowSet getRowSet(String sql,
                               Connection conn,
                               CompiereDatabase db)
                        throws SQLException
Get and Execute Row Set. No parameters, Read-Only, Scroll Insensitive

Parameters:
sql - sql
conn - connection
db - database
Returns:
row set
Throws:
SQLException

getRowSet

public static RowSet getRowSet(ResultSet rs,
                               CompiereDatabase db)
                        throws SQLException
Get Cached Row Set. Required due to Java Sun bug 393865. Also, Oracle NUMBER returns scale -127

Parameters:
rs - result set
db - database
Returns:
Cached Row Set
Throws:
SQLException

getRowSet

public static RowSet getRowSet(ResultSet rs)
                        throws SQLException
Get Cached Row Set. Gets Database from DB Required due to Java Sun bug 393865. Also, Oracle NUMBER returns scale -127

Parameters:
rs - result set
Returns:
Cached Row Set
Throws:
SQLException

main

public static void main(String[] args)
Test

Parameters:
args - ignored

toCollection

public Collection<?> toCollection()
                           throws SQLException
To Collection

Specified by:
toCollection in interface CachedRowSet
Overrides:
toCollection in class CachedRowSetImpl
Returns:
a Collection object that contains the values in each row in this CachedRowSet object
Throws:
SQLException
See Also:
CachedRowSetImpl.toCollection(int), CachedRowSetImpl.toCollection(String), TreeMap

toCollection

public Collection<?> toCollection(int column)
                           throws SQLException
To Collection

Specified by:
toCollection in interface CachedRowSet
Overrides:
toCollection in class CachedRowSetImpl
Parameters:
column - an int indicating the column whose values are to be represented in a Collection object
Returns:
a Collection object that contains the values stored in the specified column of this CachedRowSet object
Throws:
SQLException
See Also:
CachedRowSetImpl.toCollection(), CachedRowSetImpl.toCollection(String), Vector

toCollection

public Collection<?> toCollection(String column)
                           throws SQLException
To Collection

Specified by:
toCollection in interface CachedRowSet
Overrides:
toCollection in class CachedRowSetImpl
Parameters:
column - a String object giving the name of the column whose values are to be represented in a collection
Returns:
a Collection object that contains the values stored in the specified column of this CachedRowSet object
Throws:
SQLException - if an error occurs generating the collection or an invalid column id is provided
See Also:
CachedRowSetImpl.toCollection(), CachedRowSetImpl.toCollection(int), Vector

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.