|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.micro.JdbcMeOfflineResultSet
public class JdbcMeOfflineResultSet extends Object implements ResultSet
JdbcMeOfflineResultSet implements the java.sql.ResultSet interface as provided for a Java 2 Micro-Edition device over the top of an existing MIDP Record Store or a Palm OS database.
Note: Since Java 2 Micro-Edition does not include java.sql, JdbcMeOfflineResultSet implements the java.sql package that is also part of this driver.
Modifier and Type | Field and Description |
---|---|
static int |
AFTER_LAST_ROW
Row position is after the last row of the result set. |
static int |
BEFORE_FIRST_ROW
Row position is before the first row of the result set. |
Fields inherited from interface java.sql.ResultSet |
---|
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE |
Constructor and Description |
---|
JdbcMeOfflineResultSet(String dbName,
int dbCreator,
int dbType)
Construct a result set based on the offline data indicated. |
JdbcMeOfflineResultSet(String dbName,
int dbCreator,
int dbType,
int numColumns,
int[] columnTypes)
Construct a result set based on the imported offline data records indicated. |
Modifier and Type | Method and Description |
---|---|
boolean |
absolute(int row)
Positions the cursor to an absolute row number. |
void |
close()
Close the ResultSet and the offline database. |
void |
deleteRow()
Delete the current row. |
void |
dumpDB(boolean dumpAsStrings)
Dump out the current database (Using System.out.println). |
void |
dumpDB(JdbcMeOfflineData db,
boolean dumpAsStrings)
Dump out the specified database. |
boolean |
first()
Positions the cursor to the first row. |
int |
getConcurrency()
Return the concurrency of the result set. |
int |
getCurrentRow()
Return the number of the current row in the offline DB. |
int |
getInt(int columnIndex)
Returns the value of a column as a Java int value. |
ResultSetMetaData |
getMetaData()
Returns the ResultSetMetaData object that describes the result set's columns. |
Statement |
getStatement()
Returns the statement for this result set. |
String |
getString(int columnIndex)
Returns the value of a column as a String object. |
int |
getType()
Return the type of result set. |
void |
insertRow()
Inserts the contents of the insert row into the result set and the database. |
boolean |
last()
Positions the cursor to the last row. |
void |
moveToCurrentRow()
Positions the cursor to the current row. |
void |
moveToInsertRow()
Positions the cursor to the insert row. |
boolean |
next()
Positions the cursor to the next row. |
int |
numberOfRows()
Return the number of ResultSet rows in the offline result set. |
boolean |
previous()
Positions the cursor to the previous row. |
boolean |
relative(int rows)
Positions the cursor to a relative row number. |
void |
updateInt(int columnIndex,
int value)
Updates a column in the current row using a Java int value. |
void |
updateRow()
Updates the database with the new contents of the current row. |
void |
updateString(int columnIndex,
String value)
Updates a column in the current row using a String value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.Wrapper |
---|
isWrapperFor, unwrap |
Field Detail |
---|
public static final int BEFORE_FIRST_ROW
public static final int AFTER_LAST_ROW
Constructor Detail |
---|
public JdbcMeOfflineResultSet(String dbName, int dbCreator, int dbType) throws JdbcMeException
The offline data must have been created by JdbcMe (for example via JdbcMeStatement.executeToMIDPDB() or JdbcMeStatement.executeToPalmDB()).
No Connection or Statement is required when accessing a JdbcMeOfflineResultSet.
If the RecordStore was not created with JdbcMeStatement.executeToMIDPDB(), the constructor JdbcMeOfflineResultSet(String, int, int, int, int[]) should be used to allow you to define meta-data about the imported database.
dbName
- The name of the offline database.dbCreator
- The unique offline database creator identifier.dbType
- The unique offline database type identifier.JdbcMeException
- If an error occurs.public JdbcMeOfflineResultSet(String dbName, int dbCreator, int dbType, int numColumns, int[] columnTypes) throws JdbcMeException
No Connection or Statement is required when accesing a JdbcMeOfflineResultSet.
An imported offline data store (Palm DB or MIDP record store) is created by some other application. The caller indicates the number of columns and the format of the data using the numColumns and columnTypes parameters.
The offline data must be a proper result set (i.e. number of records in the offline data must evenly divisible by the number of columns). The length of the 'columnTypes' array must equal the 'numColumns' parameter.
dbName
- The name of the offline database.dbCreator
- The unique offline database creator identifier.dbType
- The unique offline database type identifier.numColumns
- The number of columns.columnTypes
- The column types.JdbcMeException
- If an error occurs.Method Detail |
---|
public void close() throws JdbcMeException
close
in interface ResultSet
JdbcMeException
- If an error occurs.public void deleteRow() throws JdbcMeException
deleteRow
in interface ResultSet
JdbcMeException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the cursor is positioned on the insert row,
or an error occurs.public String getString(int columnIndex) throws JdbcMeException
getString
in interface ResultSet
columnIndex
- The column index (1-based).JdbcMeException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public int getInt(int columnIndex) throws JdbcMeException
getInt
in interface ResultSet
columnIndex
- The column index (1-based).JdbcMeException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void insertRow() throws JdbcMeException
Note: This method is currently not implemented and will throw a JdbcMeException.
insertRow
in interface ResultSet
JdbcMeException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on the insert row,
a column that is not nullable was not specified,
or an error occurs.public void moveToInsertRow() throws JdbcMeException
Note: This method is currently not implemented and will throw a JdbcMeException.
moveToInsertRow
in interface ResultSet
JdbcMeException
- Always thrown. This method is
not implemented in an offline result set.public void moveToCurrentRow() throws JdbcMeException
If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.
Note: This method is currently not implemented and will throw a JdbcMeException.
moveToCurrentRow
in interface ResultSet
JdbcMeException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public boolean next() throws JdbcMeException
next
in interface ResultSet
JdbcMeException
- If the result set is not open,
or an error occurs.public boolean previous() throws JdbcMeException
previous
in interface ResultSet
JdbcMeException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public boolean relative(int rows) throws JdbcMeException
Attempting to move beyond the first row positions the cursor before the first row. Attempting to move beyond the last row positions the cursor after the last row.
If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.
relative
in interface ResultSet
rows
- The relative row number. If the relative row
number is positive, this positions the cursor
after the current position. If the relative
row number is negative, this positions the
cursor before the current position. If the
relative row number is 0, then the cursor
position does not change.JdbcMeException
- If the result set is not open,
the result set is not scrollable,
the cursor is not positioned on a valid row,
or an error occurs.public boolean first() throws JdbcMeException
first
in interface ResultSet
JdbcMeException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public boolean last() throws JdbcMeException
last
in interface ResultSet
JdbcMeException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public boolean absolute(int row) throws JdbcMeException
Attempting to move any number of positions before the first row positions the cursor to before the first row. Attempting to move beyond the last row positions the cursor after the last row.
If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.
absolute
in interface ResultSet
row
- The absolute row number. If the absolute row
number is positive, this positions the cursor
with respect to the beginning of the result set.
If the absolute row number is negative, this
positions the cursor with respect to the end
of result set.JdbcMeException
- If the result set is not open,
the result set is not scrollable,
the row number is 0,
or an error occurs.public void updateString(int columnIndex, String value) throws JdbcMeException
The updateString for the JdbcMeOfflineResultSet works rather differently than a standard result set, it updates the column specified by the 'columnIndex' parameter IMMEDIATELY, and IN PLACE. It does not require movement out of the current row, nor does it cause any cursor movement. It simply updates the value.
updateString
in interface ResultSet
columnIndex
- The column index (1-based).value
- The column value or null to update
the value to SQL NULL.JdbcMeException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid,
or the requested conversion is not valid.public void updateInt(int columnIndex, int value) throws JdbcMeException
The updateInt for the JdbcMeOfflineResultSet works rather differently than a standard result set, it updates the column specified by the 'columnIndex' parameter IMMEDIATELY, and IN PLACE. It does not require movement out of the current row, nor does it cause any cursor movement. It simply updates the value.
updateInt
in interface ResultSet
columnIndex
- The column index (1-based).value
- The column value.JdbcMeException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateRow() throws JdbcMeException
Note: This method is currently not implemented.
updateRow
in interface ResultSet
JdbcMeException
- This exception is never thrown.public ResultSetMetaData getMetaData() throws JdbcMeException
getMetaData
in interface ResultSet
JdbcMeException
- If an error occurs.public Statement getStatement() throws JdbcMeException
Note: This method returns null, no JdbcMeOfflineResultSet is ever owned by a statement.
getStatement
in interface ResultSet
JdbcMeException
- This exception is never thrown.public void dumpDB(boolean dumpAsStrings) throws JdbcMeException
dumpAsStrings
- true to convert the database hex values to strings; false otherwise.JdbcMeException
- If an error occurs.public void dumpDB(JdbcMeOfflineData db, boolean dumpAsStrings) throws JdbcMeException
db
- The database.dumpAsStrings
- true to convert the database hex values to strings; false otherwise.JdbcMeException
- If an error occurs.public int numberOfRows()
public int getCurrentRow()
public int getType() throws JdbcMeException
All offline database result sets are TYPE_SCROLL_SENSITIVE.
getType
in interface ResultSet
JdbcMeException
- If the result set is not open.public int getConcurrency() throws JdbcMeException
All offline database result sets are CONCUR_UPDATABLE.
getConcurrency
in interface ResultSet
JdbcMeException
- If the result set is not open.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |