generalDatabase.pamCursor
Class ScrollablePamCursor

java.lang.Object
  extended by generalDatabase.pamCursor.PamCursor
      extended by generalDatabase.pamCursor.ScrollablePamCursor

public class ScrollablePamCursor
extends PamCursor


Field Summary
private  java.sql.ResultSet scrollableCursor
           
 
Constructor Summary
ScrollablePamCursor(EmptyTableDefinition tableDefinition)
           
 
Method Summary
 boolean absolute(int row)
          Go t0 an absolute row number
 void afterLast()
           
 void beforeFirst()
           
 void close()
           
 boolean closeScrollableCursor()
          Close the scrollable cursor.
 void deleteRow()
           
 int findColumn(java.lang.String columnLabel)
           
 boolean first()
           
 boolean getBoolean(int columnIndex)
           
 byte getByte(int columnIndex)
           
 java.sql.Date getDate(int columnIndex)
           
 java.sql.Date getDate(int columnIndex, java.util.Calendar cal)
           
 double getDouble(int columnIndex)
           
 float getFloat(int columnIndex)
           
 int getInt(int columnIndex)
           
(package private)  int getLastDatabaseIndex(java.sql.Connection connection, java.sql.PreparedStatement preparedInsertStatement)
          Gets called from ImmediateInsert to get the last database index using a couple of alternate methods.
 long getLong(int columnIndex)
           
 java.lang.Object getObject(int columnIndex)
           
 int getRow()
          Retrieves the current row number.
 java.sql.RowId getRowId(int columnIndex)
           
 java.lang.String getString(int columnIndex)
           
 java.sql.Time getTime(int columnIndex)
           
 java.sql.Timestamp getTimestamp(int columnIndex)
           
 int insertRow(boolean getIndex)
          Insert row statement
 boolean isAfterLast()
           
 boolean isBeforeFirst()
           
 boolean isClosed()
           
 boolean isFirst()
           
 boolean isLast()
           
 boolean last()
           
 void moveToCurrentRow()
           
 void moveToInsertRow()
           
 boolean next()
           
 boolean openScrollableCursor(java.sql.Connection connection, boolean includeKeys, boolean includeCounters, java.lang.String clause)
          Open a scrollable cursor
 boolean previous()
           
 void refreshRow()
           
 boolean rowDeleted()
           
 boolean rowInserted()
           
 boolean rowUpdated()
           
 void updateBoolean(int columnIndex, boolean x)
           
 void updateByte(int columnIndex, byte x)
           
 boolean updateDatabase()
          Push everything down onto the database
 void updateInt(int columnIndex, int x)
           
 void updateLong(int columnIndex, long x)
           
 void updateNull(int columnIndex)
           
 void updateObject(int columnIndex, java.lang.Object x)
           
 void updateRow()
           
 void updateShort(int columnIndex, short x)
           
 void updateString(int columnIndex, java.lang.String x)
           
 void updateTimestamp(int columnIndex, java.sql.Timestamp x)
           
 
Methods inherited from class generalDatabase.pamCursor.PamCursor
finalize, getCurrentConnection, getInsertString, getSelectString, getSelectString, getTableDefinition, getUpdateString, immediateInsert, immediateUpdate, moveDataToCursor, moveDataToTableDef, openInsertCursor, openReadOnlyCursor, setCurrentConnection
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scrollableCursor

private java.sql.ResultSet scrollableCursor
Constructor Detail

ScrollablePamCursor

public ScrollablePamCursor(EmptyTableDefinition tableDefinition)
Method Detail

openScrollableCursor

public boolean openScrollableCursor(java.sql.Connection connection,
                                    boolean includeKeys,
                                    boolean includeCounters,
                                    java.lang.String clause)
Description copied from class: PamCursor
Open a scrollable cursor

Specified by:
openScrollableCursor in class PamCursor
Parameters:
connection - database connection
includeKeys - include keys
includeCounters - inlcude counters
clause - selection and ordering clause.
Returns:
true if successfully opened.

closeScrollableCursor

public boolean closeScrollableCursor()
Description copied from class: PamCursor
Close the scrollable cursor.

Specified by:
closeScrollableCursor in class PamCursor
Returns:
true if no exception.

getLastDatabaseIndex

int getLastDatabaseIndex(java.sql.Connection connection,
                         java.sql.PreparedStatement preparedInsertStatement)
Description copied from class: PamCursor
Gets called from ImmediateInsert to get the last database index using a couple of alternate methods.

Specified by:
getLastDatabaseIndex in class PamCursor
Returns:

updateDatabase

public boolean updateDatabase()
Description copied from class: PamCursor
Push everything down onto the database

Specified by:
updateDatabase in class PamCursor
Returns:
true if no errors or exceptions.

absolute

public boolean absolute(int row)
Description copied from class: PamCursor
Go t0 an absolute row number

Note that row numbers are 1 indexed.

Specified by:
absolute in class PamCursor
Parameters:
row - Row number
Returns:
true if the row is accessed.

afterLast

public void afterLast()
Specified by:
afterLast in class PamCursor

beforeFirst

public void beforeFirst()
Specified by:
beforeFirst in class PamCursor

close

public void close()
Specified by:
close in class PamCursor

deleteRow

public void deleteRow()
Specified by:
deleteRow in class PamCursor

findColumn

public int findColumn(java.lang.String columnLabel)
Specified by:
findColumn in class PamCursor

first

public boolean first()
Specified by:
first in class PamCursor

getRow

public int getRow()
           throws java.sql.SQLException
Description copied from class: PamCursor
Retrieves the current row number. The first row is number 1, the second number 2, and so on.

Specified by:
getRow in class PamCursor
Returns:
the current Row number or 0 if there is no current row
Throws:
java.sql.SQLException - if a database error occurs

getObject

public java.lang.Object getObject(int columnIndex)
Specified by:
getObject in class PamCursor

getBoolean

public boolean getBoolean(int columnIndex)
Specified by:
getBoolean in class PamCursor

getByte

public byte getByte(int columnIndex)
Specified by:
getByte in class PamCursor

getDate

public java.sql.Date getDate(int columnIndex,
                             java.util.Calendar cal)
Specified by:
getDate in class PamCursor

getDate

public java.sql.Date getDate(int columnIndex)
Specified by:
getDate in class PamCursor

getDouble

public double getDouble(int columnIndex)
Specified by:
getDouble in class PamCursor

getFloat

public float getFloat(int columnIndex)
Specified by:
getFloat in class PamCursor

getInt

public int getInt(int columnIndex)
Specified by:
getInt in class PamCursor

getLong

public long getLong(int columnIndex)
Specified by:
getLong in class PamCursor

getRowId

public java.sql.RowId getRowId(int columnIndex)
Specified by:
getRowId in class PamCursor

getString

public java.lang.String getString(int columnIndex)
Specified by:
getString in class PamCursor

getTime

public java.sql.Time getTime(int columnIndex)
Specified by:
getTime in class PamCursor

getTimestamp

public java.sql.Timestamp getTimestamp(int columnIndex)
Specified by:
getTimestamp in class PamCursor

isAfterLast

public boolean isAfterLast()
Specified by:
isAfterLast in class PamCursor

isBeforeFirst

public boolean isBeforeFirst()
Specified by:
isBeforeFirst in class PamCursor

isClosed

public boolean isClosed()
Specified by:
isClosed in class PamCursor

isFirst

public boolean isFirst()
Specified by:
isFirst in class PamCursor

isLast

public boolean isLast()
Specified by:
isLast in class PamCursor

last

public boolean last()
Specified by:
last in class PamCursor

moveToCurrentRow

public void moveToCurrentRow()
Specified by:
moveToCurrentRow in class PamCursor

moveToInsertRow

public void moveToInsertRow()
Specified by:
moveToInsertRow in class PamCursor

insertRow

public int insertRow(boolean getIndex)
Description copied from class: PamCursor
Insert row statement

Specified by:
insertRow in class PamCursor
Parameters:
getIndex - set true if you want to return the new database index. Otherwise 0 will be returned.
Returns:
return the database iD for the newly inserted item, -1 for an error or 0 if no index requested.

next

public boolean next()
Specified by:
next in class PamCursor

previous

public boolean previous()
Specified by:
previous in class PamCursor

refreshRow

public void refreshRow()
Specified by:
refreshRow in class PamCursor

rowDeleted

public boolean rowDeleted()
Specified by:
rowDeleted in class PamCursor

rowInserted

public boolean rowInserted()
Specified by:
rowInserted in class PamCursor

rowUpdated

public boolean rowUpdated()
Specified by:
rowUpdated in class PamCursor

updateObject

public void updateObject(int columnIndex,
                         java.lang.Object x)
                  throws java.sql.SQLException
Specified by:
updateObject in class PamCursor
Throws:
java.sql.SQLException

updateBoolean

public void updateBoolean(int columnIndex,
                          boolean x)
                   throws java.sql.SQLException
Specified by:
updateBoolean in class PamCursor
Throws:
java.sql.SQLException

updateByte

public void updateByte(int columnIndex,
                       byte x)
                throws java.sql.SQLException
Specified by:
updateByte in class PamCursor
Throws:
java.sql.SQLException

updateInt

public void updateInt(int columnIndex,
                      int x)
               throws java.sql.SQLException
Specified by:
updateInt in class PamCursor
Throws:
java.sql.SQLException

updateLong

public void updateLong(int columnIndex,
                       long x)
                throws java.sql.SQLException
Specified by:
updateLong in class PamCursor
Throws:
java.sql.SQLException

updateNull

public void updateNull(int columnIndex)
                throws java.sql.SQLException
Specified by:
updateNull in class PamCursor
Throws:
java.sql.SQLException

updateRow

public void updateRow()
               throws java.sql.SQLException
Specified by:
updateRow in class PamCursor
Throws:
java.sql.SQLException

updateString

public void updateString(int columnIndex,
                         java.lang.String x)
                  throws java.sql.SQLException
Specified by:
updateString in class PamCursor
Throws:
java.sql.SQLException

updateShort

public void updateShort(int columnIndex,
                        short x)
                 throws java.sql.SQLException
Specified by:
updateShort in class PamCursor
Throws:
java.sql.SQLException

updateTimestamp

public void updateTimestamp(int columnIndex,
                            java.sql.Timestamp x)
                     throws java.sql.SQLException
Specified by:
updateTimestamp in class PamCursor
Throws:
java.sql.SQLException