Package generalDatabase.pamCursor
Class NonScrollablePamCursor
java.lang.Object
generalDatabase.pamCursor.PamCursor
generalDatabase.pamCursor.NonScrollablePamCursor
A wrapper around non scrollable cursors to make them behave in the same
way as a scrollable cursor.
When the cursor is opened, all data are fetched into memory buffers and the statement used to fetch the data is closed.
The data consist of arrays of type Object. These can be fetched and scrolled through as though we were using a scrollable cursor working on the database.
Whenever a row is updated, a simpel query which updates that single row get's called.
- Author:
- Doug
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
absolute
(int row) Go t0 an absolute row numbervoid
void
void
close()
boolean
Close the scrollable cursor.void
int
findColumn
(String columnLabel) boolean
first()
boolean
getBoolean
(int columnIndex) byte
getByte
(int columnIndex) getDate
(int columnIndex) double
getDouble
(int columnIndex) float
getFloat
(int columnIndex) int
getInt
(int columnIndex) long
getLong
(int columnIndex) getObject
(int columnIndex) int
getRow()
Retrieves the current row number.getRowId
(int columnIndex) getString
(int columnIndex) getTime
(int columnIndex) getTimestampMillis
(int columnIndex) int
insertRow
(boolean getIndex) Insert row statementboolean
boolean
boolean
isClosed()
boolean
isFirst()
boolean
isLast()
boolean
last()
void
void
boolean
next()
boolean
openScrollableCursor
(PamConnection connection, boolean includeKeys, boolean includeCounters, String clause) Open a scrollable cursorboolean
previous()
void
boolean
boolean
boolean
void
updateBoolean
(int columnIndex, boolean x) void
updateByte
(int columnIndex, byte x) boolean
Push everything down onto the databasevoid
updateInt
(int columnIndex, int x) void
updateLong
(int columnIndex, long x) void
updateNull
(int columnIndex) void
updateObject
(int columnIndex, Object x) void
void
updateShort
(int columnIndex, short x) void
updateString
(int columnIndex, String x) void
updateTimestamp
(int columnIndex, Timestamp x) Methods inherited from class generalDatabase.pamCursor.PamCursor
closeCursors, executeReadOnlyStatement, getCurrentConnection, getInsertString, getSelectString, getSelectString, getSelectString, getTableDefinition, getUpdateString, getUTCTime, immediateInsert, immediateUpdate, moveDataToCursor, moveDataToTableDef, openInsertCursor, openReadOnlyCursor, openReadOnlyCursorWithStatement, setCurrentConnection
-
Constructor Details
-
NonScrollablePamCursor
-
-
Method Details
-
openScrollableCursor
public boolean openScrollableCursor(PamConnection connection, boolean includeKeys, boolean includeCounters, String clause) Description copied from class:PamCursor
Open a scrollable cursor- Specified by:
openScrollableCursor
in classPamCursor
- Parameters:
connection
- database connectionincludeKeys
- include keysincludeCounters
- inlcude countersclause
- 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 classPamCursor
- Returns:
- true if no exception.
-
updateDatabase
public boolean updateDatabase()Description copied from class:PamCursor
Push everything down onto the database- Specified by:
updateDatabase
in classPamCursor
- Returns:
- true if no errors or exceptions.
-
absolute
public boolean absolute(int row) Description copied from class:PamCursor
Go t0 an absolute row numberNote that row numbers are 1 indexed.
-
beforeFirst
public void beforeFirst()- Specified by:
beforeFirst
in classPamCursor
-
afterLast
public void afterLast() -
first
public boolean first() -
last
public boolean last() -
next
public boolean next() -
previous
public boolean previous() -
close
public void close() -
deleteRow
public void deleteRow() -
findColumn
- Specified by:
findColumn
in classPamCursor
-
getRow
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 classPamCursor
- Returns:
- the current Row number or 0 if there is no current row
- Throws:
SQLException
- if a database error occurs
-
getObject
-
getBoolean
public boolean getBoolean(int columnIndex) - Specified by:
getBoolean
in classPamCursor
-
getByte
public byte getByte(int columnIndex) -
getDate
-
getDate
-
getDouble
public double getDouble(int columnIndex) -
getFloat
public float getFloat(int columnIndex) -
getInt
public int getInt(int columnIndex) -
getLong
public long getLong(int columnIndex) -
getRowId
-
getString
-
getTime
-
getTimestampMillis
- Specified by:
getTimestampMillis
in classPamCursor
-
isAfterLast
public boolean isAfterLast()- Specified by:
isAfterLast
in classPamCursor
-
isBeforeFirst
public boolean isBeforeFirst()- Specified by:
isBeforeFirst
in classPamCursor
-
isClosed
public boolean isClosed() -
isFirst
public boolean isFirst() -
isLast
public boolean isLast() -
moveToCurrentRow
public void moveToCurrentRow()- Specified by:
moveToCurrentRow
in classPamCursor
-
moveToInsertRow
public void moveToInsertRow()- Specified by:
moveToInsertRow
in classPamCursor
-
insertRow
public int insertRow(boolean getIndex) Description copied from class:PamCursor
Insert row statement -
refreshRow
public void refreshRow()- Specified by:
refreshRow
in classPamCursor
-
rowDeleted
public boolean rowDeleted()- Specified by:
rowDeleted
in classPamCursor
-
rowInserted
public boolean rowInserted()- Specified by:
rowInserted
in classPamCursor
-
rowUpdated
public boolean rowUpdated()- Specified by:
rowUpdated
in classPamCursor
-
updateObject
- Specified by:
updateObject
in classPamCursor
- Throws:
SQLException
-
updateBoolean
- Specified by:
updateBoolean
in classPamCursor
- Throws:
SQLException
-
updateByte
- Specified by:
updateByte
in classPamCursor
- Throws:
SQLException
-
updateInt
- Specified by:
updateInt
in classPamCursor
- Throws:
SQLException
-
updateLong
- Specified by:
updateLong
in classPamCursor
- Throws:
SQLException
-
updateNull
- Specified by:
updateNull
in classPamCursor
- Throws:
SQLException
-
updateRow
- Specified by:
updateRow
in classPamCursor
- Throws:
SQLException
-
updateString
- Specified by:
updateString
in classPamCursor
- Throws:
SQLException
-
updateShort
- Specified by:
updateShort
in classPamCursor
- Throws:
SQLException
-
updateTimestamp
- Specified by:
updateTimestamp
in classPamCursor
- Throws:
SQLException
-