org.firebirdsql.jdbc
Class FBUpdatableFetcher

java.lang.Object
  extended byorg.firebirdsql.jdbc.FBStatementFetcher
      extended byorg.firebirdsql.jdbc.FBUpdatableFetcher
All Implemented Interfaces:
org.firebirdsql.jdbc.FBFetcher

public class FBUpdatableFetcher
extends org.firebirdsql.jdbc.FBStatementFetcher

Statement fetcher for updatable cursor case. This fetcher keeps cursor position consistent, however we cannot tell now if we are on the last record. Method isLast() throws exception now.

Author:
Roman Rokytskyy

Field Summary
protected  byte[][] _nextRow
           
protected  AbstractStatement fbStatement
           
static int MAX_FETCH_ROWS
           
protected  FBResultSet rs
           
 
Method Summary
 boolean absolute(int row)
          Move cursor to the absolute row.
 void afterLast()
          Move cursor after last record.
 void beforeFirst()
          Move cursor before first record.
 void close()
          Close this fetcher and corresponding result set.
 void fetch()
           
 boolean first()
          Move cursor to the rist row.
protected  byte[][] getNextRow()
           
 int getRowNum()
          Get row number.
 AbstractStatement getStatement()
          Get statement to which this fetcher belongs to.
 boolean isAfterLast()
           
 boolean isBeforeFirst()
           
 boolean isEmpty()
           
 boolean isFirst()
           
 boolean isLast()
           
 boolean last()
          Move cursor to the last row.
 boolean next()
          Move to next row.
 boolean previous()
          Move cursor to the previous row.
 boolean relative(int row)
          Move cursor relative to the current row.
 void setIsAfterLast(boolean isAfterLastValue)
           
 void setIsBeforeFirst(boolean isBeforeFirstValue)
           
 void setIsEmpty(boolean isEmptyValue)
           
 void setIsFirst(boolean isFirstValue)
           
 void setIsLast(boolean isLastValue)
           
protected  void setNextRow(byte[][] nextRow)
           
 void setRowNum(int rowNumValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fbStatement

protected AbstractStatement fbStatement

rs

protected FBResultSet rs

_nextRow

protected byte[][] _nextRow

MAX_FETCH_ROWS

public static final int MAX_FETCH_ROWS
See Also:
Constant Field Values
Method Detail

next

public boolean next()
             throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Move to next row.

Throws:
java.sql.SQLException

isLast

public boolean isLast()
               throws java.sql.SQLException
Throws:
java.sql.SQLException

getNextRow

protected byte[][] getNextRow()
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

setNextRow

protected void setNextRow(byte[][] nextRow)

absolute

public boolean absolute(int row)
                 throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Move cursor to the absolute row.

Specified by:
absolute in interface org.firebirdsql.jdbc.FBFetcher
Parameters:
row - absolute row number.
Returns:
true if cursor was successfully moved.
Throws:
java.sql.SQLException - if something went wrong.

first

public boolean first()
              throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Move cursor to the rist row.

Specified by:
first in interface org.firebirdsql.jdbc.FBFetcher
Returns:
true if cursor was moved to the first row.
Throws:
java.sql.SQLException - if something went wrong.

last

public boolean last()
             throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Move cursor to the last row.

Specified by:
last in interface org.firebirdsql.jdbc.FBFetcher
Returns:
true if cursor was moved to the last row.
Throws:
java.sql.SQLException - if something went wrong.

previous

public boolean previous()
                 throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Move cursor to the previous row.

Specified by:
previous in interface org.firebirdsql.jdbc.FBFetcher
Returns:
true if cursor was moved to the prevous row.
Throws:
java.sql.SQLException - if something went wrong.

relative

public boolean relative(int row)
                 throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Move cursor relative to the current row.

Specified by:
relative in interface org.firebirdsql.jdbc.FBFetcher
Parameters:
row - relative row position.
Returns:
true if cursor was successfully moved.
Throws:
java.sql.SQLException - if something went wrong.

beforeFirst

public void beforeFirst()
                 throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Move cursor before first record.

Specified by:
beforeFirst in interface org.firebirdsql.jdbc.FBFetcher
Throws:
java.sql.SQLException - if something went wrong.

afterLast

public void afterLast()
               throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Move cursor after last record.

Specified by:
afterLast in interface org.firebirdsql.jdbc.FBFetcher
Throws:
java.sql.SQLException - if something went wrong.

fetch

public void fetch()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Close this fetcher and corresponding result set.

Specified by:
close in interface org.firebirdsql.jdbc.FBFetcher
Throws:
java.sql.SQLException - if something went wrong.

getStatement

public AbstractStatement getStatement()
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Get statement to which this fetcher belongs to.

Specified by:
getStatement in interface org.firebirdsql.jdbc.FBFetcher
Returns:
instance of AbstractStatement.

getRowNum

public int getRowNum()
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Get row number.

Specified by:
getRowNum in interface org.firebirdsql.jdbc.FBFetcher
Returns:
row number.

setRowNum

public void setRowNum(int rowNumValue)

isEmpty

public boolean isEmpty()
                throws java.sql.SQLException
Specified by:
isEmpty in interface org.firebirdsql.jdbc.FBFetcher
Throws:
java.sql.SQLException

setIsEmpty

public void setIsEmpty(boolean isEmptyValue)

isBeforeFirst

public boolean isBeforeFirst()
                      throws java.sql.SQLException
Specified by:
isBeforeFirst in interface org.firebirdsql.jdbc.FBFetcher
Throws:
java.sql.SQLException

setIsBeforeFirst

public void setIsBeforeFirst(boolean isBeforeFirstValue)

isFirst

public boolean isFirst()
                throws java.sql.SQLException
Specified by:
isFirst in interface org.firebirdsql.jdbc.FBFetcher
Throws:
java.sql.SQLException

setIsFirst

public void setIsFirst(boolean isFirstValue)

setIsLast

public void setIsLast(boolean isLastValue)

isAfterLast

public boolean isAfterLast()
                    throws java.sql.SQLException
Specified by:
isAfterLast in interface org.firebirdsql.jdbc.FBFetcher
Throws:
java.sql.SQLException

setIsAfterLast

public void setIsAfterLast(boolean isAfterLastValue)


Copyright © 2001 David Jencks and other authors. All rights reserved.