|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bsf.commons.ejb.GenericAdapterBean
org.bsf.commons.ejb.SessionAdapterBean
org.bsf.remoteIterator.server.RemoteIteratorBean
Executes and provides an iterator on a SQL statement using the Bean container to handle passivation and so on... Usually used to populate a Table on the client without transfering all the rows at once.
Field Summary | |
private java.util.List |
_columnMetadatas
|
private java.sql.Connection |
_connection
|
private int |
_defaultBlockSize
|
private int |
_lastReadBlockSize
Keeps the size of the last read block. |
private int |
_position
The curent position into the resultset (needed when passivated or activated). |
private java.sql.ResultSet |
_resultSet
|
private java.lang.String |
_SQLQuery
|
private java.sql.Statement |
_statement
|
private static java.lang.String |
EMPTY_STRING
|
private static java.lang.String |
JNDI_DATASOURCE_NAME
|
private static int |
RI_BUFFER_SIZE
|
private static int |
RI_DEFAULT_BLOCK_SIZE
|
Fields inherited from class org.bsf.commons.ejb.SessionAdapterBean |
_ejbContext |
Fields inherited from class org.bsf.commons.ejb.GenericAdapterBean |
|
Constructor Summary | |
RemoteIteratorBean()
|
Method Summary | |
RemoteIteratorResultTable |
absolute(int p_position)
|
RemoteIteratorResultTable |
absolute(int p_position,
int p_blockSize)
|
private void |
addCurrentResultSetRow(RemoteIteratorResultTable p_resultTable)
Adds the current record to the given RemoteIteratorResultTable. |
private void |
closeDataSource()
Closes the DB ressources (ResultSet, Statement, Connection). |
private void |
createMetadatas()
Creates the meta data from the actual resultsets. |
void |
ejbActivate()
|
void |
ejbCreate(java.lang.String p_query)
|
void |
ejbPassivate()
|
void |
ejbRemove()
Ensures that everything is closed correctly (mainly the DB ressources). |
private void |
executeQuery()
Prepares and executes the SQL query. |
private void |
firstQueryExecution()
Should be called for the first execution of the Query (opens the DataSource and executes the query). |
java.util.List |
getColumnMetaData()
|
private int |
getPosition()
|
java.lang.Long |
getRowCount()
|
private boolean |
isAfterLast()
|
private boolean |
isBeforeFirst()
|
private boolean |
isLast()
|
RemoteIteratorResultTable |
next()
|
RemoteIteratorResultTable |
next(int p_blockSize)
|
private void |
openDataSource()
Retrieves a connection to the Database. |
private void |
prepareQuery()
Must be called before executeQuery as it creates the statement and configures it. |
RemoteIteratorResultTable |
previous()
|
RemoteIteratorResultTable |
previous(int p_blockSize)
|
private void |
restorePosition(int p_position,
int p_lastReadBlockSize)
Sets the cursor to the specified position and update the lastReadBlockSize. |
void |
setDefaultBlockSize(java.lang.Integer p_defaultBlockSize)
Sets the default block size to be used for this RemoteIteratorBean. |
Methods inherited from class org.bsf.commons.ejb.SessionAdapterBean |
ejbCreate, getEJBContext, getUserName, setSessionContext |
Methods inherited from class org.bsf.commons.ejb.GenericAdapterBean |
getConnection, getEJBClassName, getEJBToolBox, getHome, handleCreateSessionException, handleExceptionAsSystemException, handleFinderException, handleRemoteException, handleSQLException, logDebug, logError, logError, logFatal, logFatal, logGraphBegin, logGraphEnd, logInfo, logWarn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int RI_BUFFER_SIZE
private static final int RI_DEFAULT_BLOCK_SIZE
private static final java.lang.String EMPTY_STRING
private static final java.lang.String JNDI_DATASOURCE_NAME
private int _lastReadBlockSize
private int _position
private java.lang.String _SQLQuery
private java.util.List _columnMetadatas
private int _defaultBlockSize
private transient java.sql.Statement _statement
private transient java.sql.ResultSet _resultSet
private transient java.sql.Connection _connection
Constructor Detail |
public RemoteIteratorBean()
Method Detail |
private void createMetadatas()
public void ejbCreate(java.lang.String p_query) throws javax.ejb.CreateException
p_query
- The SQL statement to execute. It should be a valid SQL statement
otherwise you'll get an SQL exception later :o) !!!
java.lang.RuntimeException
- if the given query is null or blank.
javax.ejb.CreateException
public void ejbRemove()
public java.util.List getColumnMetaData()
ColumnMetadata
public RemoteIteratorResultTable absolute(int p_position)
absolute(int p_position, int p_blockSize)
,
RemoteIteratorResultTable
public RemoteIteratorResultTable absolute(int p_position, int p_blockSize)
absolute(int p_position)
,
RemoteIteratorResultTable
public RemoteIteratorResultTable previous()
previous(int p_blockSize)
,
RemoteIteratorResultTable
public RemoteIteratorResultTable previous(int p_blockSize)
p_blockSize
- the size of the block to return. Should be greater than
zero (not checked).
RemoteIteratorResultTable
public RemoteIteratorResultTable next()
next(int p_blockSize)
,
RemoteIteratorResultTable
public RemoteIteratorResultTable next(int p_blockSize)
p_blockSize
- the size of the block to return. Should be greater than
zero (not checked).
RemoteIteratorResultTable
public java.lang.Long getRowCount()
private boolean isLast() throws java.sql.SQLException
java.sql.SQLException
private boolean isAfterLast() throws java.sql.SQLException
java.sql.SQLException
private boolean isBeforeFirst() throws java.sql.SQLException
java.sql.SQLException
private int getPosition() throws java.sql.SQLException
java.sql.SQLException
private void restorePosition(int p_position, int p_lastReadBlockSize) throws java.sql.SQLException
java.sql.SQLException
private void addCurrentResultSetRow(RemoteIteratorResultTable p_resultTable) throws java.sql.SQLException
java.sql.SQLException
- if there's a problem in the retrieval of the record...
java.lang.NullPointerException
- if the given ResultTable is null.RemoteIteratorResultTable
private void prepareQuery() throws java.sql.SQLException
java.sql.SQLException
private void executeQuery() throws java.sql.SQLException
java.sql.SQLException
- if there's a problem while preparing or executing the SQL.private void firstQueryExecution()
private void openDataSource() throws java.sql.SQLException
java.sql.SQLException
private void closeDataSource()
public void setDefaultBlockSize(java.lang.Integer p_defaultBlockSize)
public void ejbActivate()
public void ejbPassivate()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |