/** * PUBLIC: * Moves the cursor to the last row in the result set */ public boolean last() throws DatabaseException { clearNextAndPrevious(); try { boolean isLast = this.resultSet.last(); if (!isLast) { // cursor must be empty. if (this.objectCollection.size() > 0) { setPosition(this.objectCollection.size()); isLast = true; } } else { setSize(this.objectCollection.size() + this.resultSet.getRow()); setPosition(size); } return isLast; } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the last row in the result set */ public boolean last() throws DatabaseException { clearNextAndPrevious(); try { boolean isLast = this.resultSet.last(); if (!isLast) { // cursor must be empty. if (this.objectCollection.size() > 0) { setPosition(this.objectCollection.size()); isLast = true; } } else { setSize(this.objectCollection.size() + this.resultSet.getRow()); setPosition(size); } return isLast; } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the front of the result set, just before the first row */ public void beforeFirst() throws DatabaseException { clearNextAndPrevious(); try { this.resultSet.beforeFirst(); setPosition(0); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the front of the result set, just before the first row */ public void beforeFirst() throws DatabaseException { clearNextAndPrevious(); try { this.resultSet.beforeFirst(); setPosition(0); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the first row in the result set */ public boolean first() throws DatabaseException { clearNextAndPrevious(); try { if (this.objectCollection.size() > 0) { setPosition(1); this.resultSet.beforeFirst(); return true; } else { return this.resultSet.first(); } } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the first row in the result set */ public boolean first() throws DatabaseException { clearNextAndPrevious(); try { if (this.objectCollection.size() > 0) { setPosition(1); this.resultSet.beforeFirst(); return true; } else { return this.resultSet.first(); } } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * This method differs slightly from conventinal read() operation on a Java stream. This * method return the next object in the collection rather than specifying the number of * bytes to be read in. * * Return the next object from the collection, if beyond the read limit read from the cursor * @return - next object in stream * @exception - throws exception if read pass end of stream */ public Object next() throws DatabaseException, QueryException { loadNext(); if (getNextObject() == null) { throw QueryException.readBeyondStream(getQuery()); } Object next = getNextObject(); clearNextAndPrevious(); return next; }
/** * PUBLIC: * Return the previous object from the collection. * * @return - previous object in stream * @exception - throws exception if read pass first of stream */ public Object previous() throws DatabaseException, QueryException { // CR#4139 loadPrevious(); if (getPreviousObject() == null) { throw QueryException.readBeyondStream(getQuery()); } Object previous = getPreviousObject(); clearNextAndPrevious(); return previous; }
/** * PUBLIC: * Moves the cursor to the front of the result set, just before the first row */ public void beforeFirst() throws DatabaseException { clearNextAndPrevious(); try { getResultSet().beforeFirst(); setPosition(0); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(getSession(), exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), getSession(), false); } }
/** * PUBLIC: * Moves the cursor to the last row in the result set */ public boolean last() throws DatabaseException { clearNextAndPrevious(); try { boolean isLast = getResultSet().last(); if (!isLast) { // cursor must be empty. if (getObjectCollection().size() > 0) { setPosition(getObjectCollection().size()); isLast = true; } } else { setSize(getObjectCollection().size() + getResultSet().getRow()); setPosition(size); } return isLast; } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(getSession(), exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), getSession(), false); } }
clearNextAndPrevious(); try { boolean suceeded = false;
clearNextAndPrevious(); try { boolean suceeded = false;
/** * PUBLIC: * Moves the cursor to the end of the result set, just after the last row. */ public void afterLast() throws DatabaseException { clearNextAndPrevious(); try { this.resultSet.afterLast(); setPosition(size() + 1); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the end of the result set, just after the last row. */ public void afterLast() throws DatabaseException { clearNextAndPrevious(); try { this.resultSet.afterLast(); setPosition(size() + 1); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the first row in the result set */ public boolean first() throws DatabaseException { clearNextAndPrevious(); try { if (getObjectCollection().size() > 0) { setPosition(1); getResultSet().beforeFirst(); return true; } else { return getResultSet().first(); } } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(getSession(), exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), getSession(), false); } }
clearNextAndPrevious(); try { boolean suceeded = false;
clearNextAndPrevious(); try { boolean suceeded = false;
clearNextAndPrevious(); try { boolean suceeded = false;
/** * PUBLIC: * Moves the cursor to the end of the result set, just after the last row. */ public void afterLast() throws DatabaseException { clearNextAndPrevious(); try { getResultSet().afterLast(); setPosition(size() + 1); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(getSession(), exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), getSession(), false); } }
clearNextAndPrevious(); try { boolean suceeded = false;