org.firebirdsql.jdbc
Class FBUpdatableCursorFetcher

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

public class FBUpdatableCursorFetcher
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  FBObjectListener.FetcherListener fetcherListener
           
protected  int fetchSize
           
protected  org.firebirdsql.gds.impl.GDSHelper gdsHelper
           
static int MAX_FETCH_ROWS
           
protected  int maxRows
           
protected  org.firebirdsql.gds.impl.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 org.firebirdsql.gds.impl.GDSHelper gdsHelper

fetcherListener

protected FBObjectListener.FetcherListener fetcherListener

maxRows

protected int maxRows

fetchSize

protected int fetchSize

syncProvider

protected Synchronizable syncProvider

stmt

protected org.firebirdsql.gds.impl.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 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.

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)

deleteRow

public void deleteRow()
               throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
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.

Specified by:
deleteRow in interface org.firebirdsql.jdbc.FBFetcher
Throws:
java.sql.SQLException - if operation cannot be completed.

insertRow

public void insertRow(byte[][] data)
               throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
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.

Specified by:
insertRow in interface org.firebirdsql.jdbc.FBFetcher
Parameters:
data - row data
Throws:
java.sql.SQLException - if operation cannot be completed.

updateRow

public void updateRow(byte[][] data)
               throws java.sql.SQLException
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
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.

Specified by:
updateRow in interface org.firebirdsql.jdbc.FBFetcher
Parameters:
data - row data
Throws:
java.sql.SQLException - if operation cannot be completed.

setFetchSize

public void setFetchSize(int fetchSize)
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Get the suggested number of rows to fetch with each batch fetch.

Specified by:
setFetchSize in interface org.firebirdsql.jdbc.FBFetcher
Parameters:
fetchSize - The suggested number of rows to fetch

getFetchSize

public int getFetchSize()
Description copied from interface: org.firebirdsql.jdbc.FBFetcher
Set the suggested number of rows to fetch with each batch fetch.

Specified by:
getFetchSize in interface org.firebirdsql.jdbc.FBFetcher
Returns:
The number of rows to be fetched


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