org.firebirdsql.jdbc
Class FBUpdatableCursorFetcher

java.lang.Object
  extended by org.firebirdsql.jdbc.FBUpdatableCursorFetcher

public class FBUpdatableCursorFetcher
extends Object

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  FBObjectListener.FetcherListener fetcherListener
           
protected  int fetchSize
           
protected  GDSHelper gdsHelper
           
static int MAX_FETCH_ROWS
           
protected  int maxRows
           
protected  AbstractIscStmtHandle stmt
           
protected  Synchronizable syncProvider
           
 
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 deleteRow()
          Delete row at current position.
 void fetch()
           
 boolean first()
          Move cursor to the rist row.
 int getFetchSize()
          Set the suggested number of rows to fetch with each batch fetch.
protected  byte[][] getNextRow()
           
 int getRowNum()
          Get row number.
 void insertRow(byte[][] data)
          Insert row at current position.
 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 setFetchSize(int fetchSize)
          Get the suggested number of rows to fetch with each batch fetch.
 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)
           
 void updateRow(byte[][] data)
          Update row at current position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gdsHelper

protected GDSHelper gdsHelper

fetcherListener

protected FBObjectListener.FetcherListener fetcherListener

maxRows

protected int maxRows

fetchSize

protected int fetchSize

syncProvider

protected Synchronizable syncProvider

stmt

protected AbstractIscStmtHandle stmt

_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 SQLException
Move to next row.

Returns:
true if cursor was moved.
Throws:
SQLException - if something went wrong.

isLast

public boolean isLast()
               throws SQLException
Throws:
SQLException

getNextRow

protected byte[][] getNextRow()
                       throws SQLException
Throws:
SQLException

setNextRow

protected void setNextRow(byte[][] nextRow)

absolute

public boolean absolute(int row)
                 throws SQLException
Move cursor to the absolute row.

Parameters:
row - absolute row number.
Returns:
true if cursor was successfully moved.
Throws:
SQLException - if something went wrong.

first

public boolean first()
              throws SQLException
Move cursor to the rist row.

Returns:
true if cursor was moved to the first row.
Throws:
SQLException - if something went wrong.

last

public boolean last()
             throws SQLException
Move cursor to the last row.

Returns:
true if cursor was moved to the last row.
Throws:
SQLException - if something went wrong.

previous

public boolean previous()
                 throws SQLException
Move cursor to the previous row.

Returns:
true if cursor was moved to the prevous row.
Throws:
SQLException - if something went wrong.

relative

public boolean relative(int row)
                 throws SQLException
Move cursor relative to the current row.

Parameters:
row - relative row position.
Returns:
true if cursor was successfully moved.
Throws:
SQLException - if something went wrong.

beforeFirst

public void beforeFirst()
                 throws SQLException
Move cursor before first record.

Throws:
SQLException - if something went wrong.

afterLast

public void afterLast()
               throws SQLException
Move cursor after last record.

Throws:
SQLException - if something went wrong.

fetch

public void fetch()
           throws SQLException
Throws:
SQLException

close

public void close()
           throws SQLException
Close this fetcher and corresponding result set.

Throws:
SQLException - if something went wrong.

getRowNum

public int getRowNum()
Get row number.

Returns:
row number.

setRowNum

public void setRowNum(int rowNumValue)

isEmpty

public boolean isEmpty()
                throws SQLException
Throws:
SQLException

setIsEmpty

public void setIsEmpty(boolean isEmptyValue)

isBeforeFirst

public boolean isBeforeFirst()
                      throws SQLException
Throws:
SQLException

setIsBeforeFirst

public void setIsBeforeFirst(boolean isBeforeFirstValue)

isFirst

public boolean isFirst()
                throws SQLException
Throws:
SQLException

setIsFirst

public void setIsFirst(boolean isFirstValue)

setIsLast

public void setIsLast(boolean isLastValue)

isAfterLast

public boolean isAfterLast()
                    throws SQLException
Throws:
SQLException

setIsAfterLast

public void setIsAfterLast(boolean isAfterLastValue)

deleteRow

public void deleteRow()
               throws SQLException
Delete row at current position. This method deletes a row at the current position in case of updatable result sets after successfull execution of the ResultSet#deleteRow() method.

Throws:
SQLException - if operation cannot be completed.

insertRow

public void insertRow(byte[][] data)
               throws SQLException
Insert row at current position. This method adds a row at the current position in case of updatable result sets after successfull execution of the ResultSet#insertRow() method.

Parameters:
data - row data
Throws:
SQLException - if operation cannot be completed.

updateRow

public void updateRow(byte[][] data)
               throws SQLException
Update row at current position. This method updates a row at the current position in case of updatable result sets after successfull execution of the ResultSet#updateRow() method.

Parameters:
data - row data
Throws:
SQLException - if operation cannot be completed.

setFetchSize

public void setFetchSize(int fetchSize)
Get the suggested number of rows to fetch with each batch fetch.

Parameters:
fetchSize - The suggested number of rows to fetch

getFetchSize

public int getFetchSize()
Set the suggested number of rows to fetch with each batch fetch.

Returns:
The number of rows to be fetched


Copyright © 2001-2010. All Rights Reserved.