|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sadun.util.SqlIdIterator
An IdIterator
based on an SQL statement
executed over a given Connection.
Field Summary |
Fields inherited from interface org.sadun.util.IdIterator |
BACKWARD, FORWARD |
Constructor Summary | |
SqlIdIterator(ConnectionPool connectionPool,
java.lang.String tableName,
java.lang.String idColumnName)
|
|
SqlIdIterator(ConnectionPool connectionPool,
java.lang.String tableName,
java.lang.String idColumnName,
java.lang.String upperLimit,
java.lang.String lowerLimit)
|
|
SqlIdIterator(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String idColumnName)
|
|
SqlIdIterator(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String idColumnName,
java.lang.String upperLimit,
java.lang.String lowerLimit)
|
Method Summary | |
void |
close()
Releases this SqlIdIterator 's result set and statement, but does not
close the connection.
|
java.lang.String |
getCurrentId()
Return the id on which the iterator is currently positioned. |
java.lang.String |
getNextId(int direction)
Moves the current id to the next in the given direction and returns it. |
boolean |
hasNext(int direction)
(non-Javadoc) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SqlIdIterator(ConnectionPool connectionPool, java.lang.String tableName, java.lang.String idColumnName) throws java.sql.SQLException
public SqlIdIterator(ConnectionPool connectionPool, java.lang.String tableName, java.lang.String idColumnName, java.lang.String upperLimit, java.lang.String lowerLimit) throws java.sql.SQLException
public SqlIdIterator(java.sql.Connection conn, java.lang.String tableName, java.lang.String idColumnName) throws java.sql.SQLException
public SqlIdIterator(java.sql.Connection conn, java.lang.String tableName, java.lang.String idColumnName, java.lang.String upperLimit, java.lang.String lowerLimit) throws java.sql.SQLException
Method Detail |
public boolean hasNext(int direction)
hasNext
in interface IdIterator
direction
- one of IdIterator.FORWARD
or IdIterator.BACKWARD
constants.
IdIterator.hasNext(int)
public java.lang.String getCurrentId()
IdIterator
getCurrentId
in interface IdIterator
public java.lang.String getNextId(int direction)
IdIterator
getNextId
in interface IdIterator
direction
- one of IdIterator.FORWARD
or IdIterator.BACKWARD
constants.
public void close()
SqlIdIterator
's result set and statement, but does not
close the connection.
However, if the SqlIdIterator
has been constructed via a ConnectionPool
(see
SqlIdIterator(ConnectionPool, String, String, String, String)
and
SqlIdIterator(ConnectionPool, String, String)
), the connection is released to the
pool.
close
in interface IdIterator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |