Mimer JDBC/MIDP 2.12

com.mimer.jdbc
Class ResultSet

java.lang.Object
  |
  +--com.mimer.jdbc.ResultSet

public class ResultSet
extends java.lang.Object

Represents a result set, either forward only or scrollable.

The below table shows which Mimer SQL server data types are accessible from the specified JDBC getter methods. Those data types that may be retrieved using a specific getter method may also be set using the corresponding setter method with a PreparedStatement object.

OT SI IN N(n) BI RE FL FL(n) DP DC NU BI CH CV BI BV NCH NCV DT TI TS IV IV2 BL CL NCL
getByte X x x x x x x x x x x x x x - - x x - - - - - - - -
getShort x X x x x x x x x x x x x x - - x x - - - - - - - -
getInt x x X x x x x x x x x x x x - - x x - - - - - - - -
getLong x x x x X x x x x x x x x x - - x x - - - - - - - -
getBoolean x x x x x x x x x x x X x x - - x x - - - - - - - -
getString x x x x x x x x x x x x X X - - x x x x x x x - - -
getBytes - - - - - - - - - - - - - - X X - - - - - - - - - -
getDate - - - - - - - - - - - - x x - - x x X x x - - - - -
getTime - - - - - - - - - - - - x x - - x x x X x - - - - -
getTimestamp - - - - - - - - - - - - x x - - x x x x X - - - - -
getAsciiStream - - - - - - - - - - - - x x x x x x - - - - - - x x
getBinaryStream - - - - - - - - - - - - - - x x - - - - - - - x - -
getCharacterStream - - - - - - - - - - - - x x - - x x - - - - - - x x
getClob - - - - - - - - - - - - - - - - - - - - - - - - x x
getBlob - - - - - - - - - - - - - - - - - - - - - - - x - -
getArray - - - - - - - - - - - - - - - - - - - - - - - - - -
getRef - - - - - - - - - - - - - - - - - - - - - - - - - -
getURL - - - - - - - - - - - - - - - - - - - - - - - - - -
getObject x x x x x x x x x x x x x x x x x x x x x x x x x x

Abbreviations in table above:

OTODBC.TINYINT
SISMALLINT
ININTEGER
IN(n)INTEGER(n)
BIBIGINT
REREAL
FLFLOAT
FL(n)FLOAT(n)
DPDOUBLE PRECISION
DCDECIMAL
NUNUMERIC
BIODBC.BIT
CHCHARACTER
VCCHARACTER VARYING
BIBINARY
VBBINARY VARYING
NCHNATIONAL CHARACTER
NVCNATIONAL CHARACTER VARYING
DTDATE
TITIME
TSTIMESTAMP
IVINTERVAL YEAR
INTERVAL MONTH
INTERVAL DAY
INTERVAL HOUR
INTERVAL MINUTE
INTERVAL SECOND
IV2INTERVAL YEAR TO MONTH
INTERVAL DAY TO HOUR
INTERVAL DAY TO MINUTE
INTERVAL DAY TO SECOND
INTERVAL HOUR TO MINUTE
INTERVAL HOUR TO SECOND
INTERVAL MINUTE TO SECOND
BLBINARY LARGE OBJECT
CLCHARACTER LARGE OBJECT
NCLNATIONAL CHARACTER LARGE OBJECT

Note: The Mimer JDBC for MIDP does not implement updatable result sets through the JDBC API. Instead, we refer to the SQL-99 way of updating result sets, using the UPDATE WHERE CURRENT OF and DELETE WHERE CURRENT OF statements. See the Mimer SQL Reference Manual for a description of these SQL constructs.


Field Summary
static int CONCUR_READ_ONLY
           
static int CONCUR_UPDATABLE
           
static int FETCH_FORWARD
           
static int FETCH_REVERSE
           
static int FETCH_UNKNOWN
           
static int TYPE_FORWARD_ONLY
           
static int TYPE_SCROLL_INSENSITIVE
           
static int TYPE_SCROLL_SENSITIVE
           
 
Method Summary
 boolean absolute(int row)
          Positions the cursor on a absolute position.
 void afterLast()
          Positions the cursor after the end of the result set.
 void beforeFirst()
          Positions the cursor before the beginning of the result set.
 void clearWarnings()
          Clears all warnings reported on the object.
 void close()
          Closes the statement.
 int findColumn(java.lang.String columnName)
          Finds a column index from a column name.
 boolean first()
          Positions the cursor at the first row of the result set.
 java.io.InputStream getAsciiStream(int columnIndex)
          Returns an ascii stream representing the result set column.
 java.io.InputStream getAsciiStream(java.lang.String columnName)
          Returns an ascii stream representing the result set column.
 java.io.InputStream getBinaryStream(int columnIndex)
          Returns an binary stream representing the result set column.
 java.io.InputStream getBinaryStream(java.lang.String columnName)
          Returns an binary stream representing the result set column.
 Blob getBlob(int columnIndex)
          Get a BLOB LOCATOR object.
 Blob getBlob(java.lang.String columnName)
          Get a BLOB LOCATOR object.
 boolean getBoolean(int columnIndex)
          Returns a boolean.
 boolean getBoolean(java.lang.String columnName)
          Returns a boolean.
 byte getByte(int columnIndex)
          Returns a byte.
 byte getByte(java.lang.String columnName)
          Returns a byte.
 byte[] getBytes(int columnIndex)
          Returns an array of bytes.
 byte[] getBytes(java.lang.String columnName)
          Returns an array of bytes.
 java.io.Reader getCharacterStream(int columnIndex)
          Get a character stream.
 java.io.Reader getCharacterStream(java.lang.String columnName)
          Get a character stream.
 Clob getClob(int columnIndex)
          Get a CLOB LOCATOR object.
 Clob getClob(java.lang.String columnName)
          Get a CLOB LOCATOR object.
 int getConcurrency()
          Returns the concurrency mode for this result set.
 java.lang.String getCursorName()
          Returns the name of this cursor.
 int getFetchDirection()
          Gets the current fetch direction hint.
 int getFetchSize()
          Retrieves the current fetch size.
 int getInt(int columnIndex)
          Returns an integer.
 int getInt(java.lang.String columnName)
          Returns an integer.
 long getLong(int columnIndex)
          Returns an long.
 long getLong(java.lang.String columnName)
          Returns an long.
 ResultSetMetaData getMetaData()
          Returns a ResultSetMetaData object describing the result set.
 java.lang.Object getObject(int columnIndex)
          Returns an object.
 java.lang.Object getObject(java.lang.String columnName)
          Returns an object.
 int getRow()
          Return the current row number.
 short getShort(int columnIndex)
          Returns a short.
 short getShort(java.lang.String columnName)
          Returns a short.
 Statement getStatement()
          Get the statement that belongs to this result set.
 java.lang.String getString(int columnIndex)
          Returns a string.
 java.lang.String getString(java.lang.String columnName)
          Returns a string.
 int getType()
          Return the type of the result set.
 SQLWarning getWarnings()
          Returns the first warning posted to this object.
 boolean isAfterLast()
          Returns true if the current row is after the last row of the result set.
 boolean isBeforeFirst()
          Returns true if the current row is before the first row of the result set.
 boolean isFirst()
          Returns true if the current row is at the first row of the result set.
 boolean isLast()
          Returns true if the current row is at the last row of the result set.
 boolean last()
          Positions the cursor on the last row of the result set.
 boolean next()
          Moves on to the next row in the result set.
 boolean previous()
          Positions the cursor one row backwards in the result set.
 boolean relative(int rows)
          Positioning relative to the current cursor position.
 void setFetchDirection(int direction)
          Sets the current fetch direction hint.
 void setFetchSize(int rows)
          Sets the current fetch size.
 boolean wasNull()
          Returns true if the last column read was a NULL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONCUR_READ_ONLY

public static final int CONCUR_READ_ONLY
See Also:
Constant Field Values

CONCUR_UPDATABLE

public static final int CONCUR_UPDATABLE
See Also:
Constant Field Values

FETCH_FORWARD

public static final int FETCH_FORWARD
See Also:
Constant Field Values

FETCH_REVERSE

public static final int FETCH_REVERSE
See Also:
Constant Field Values

FETCH_UNKNOWN

public static final int FETCH_UNKNOWN
See Also:
Constant Field Values

TYPE_FORWARD_ONLY

public static final int TYPE_FORWARD_ONLY
See Also:
Constant Field Values

TYPE_SCROLL_INSENSITIVE

public static final int TYPE_SCROLL_INSENSITIVE
See Also:
Constant Field Values

TYPE_SCROLL_SENSITIVE

public static final int TYPE_SCROLL_SENSITIVE
See Also:
Constant Field Values
Method Detail

absolute

public boolean absolute(int row)
                 throws SQLException
Positions the cursor on a absolute position.

Performance consideration: If the application calls ResultSet.absolute to position itself to a particular row, the entire result set up to that point has to mbecome materialized on the server. This means that positioning far ahead in the result set might take some time, but returning to a position once visited is fast. For example:

  1. ResultSet is created.
  2. ResultSet is advanced one row at a time until the 10th row.
  3. ResultSet.absolute(1000000) is called. At this time, only the beginning of the result set has been formed. To get to row 1000000 the server has to materialize all rows up to that point. This can take a while.
  4. ResultSet.absolute(100) is called. This row has already been formed, so returning to it should be nearly instantaneous.
  5. ResultSet.absolute(1000000)

In some situations, the entire result set is formed before the first row can be returned. An example of such a situation is when we have an ORDER BY clause on a non-indexed column. If this is so, we experience the penalty of forming the entire result set before the first row is returned, and then we don't see the effects outlined above.

Parameters:
row - If positive it is an absolute position from the start of the result set. If negative it is a absolute position coutned from the end of the result set.
Throws:
SQLException - if an error occurs. SQLSTATE HY109 is thrown if this is a forward-only result set. HY107 is thrown if the row parameter was 0.

afterLast

public void afterLast()
               throws SQLException
Positions the cursor after the end of the result set.

Performance consideration: If the end of result set hasn't been formed before, this operation may take some time since all rows up until the end of the result set has be formed on the server. The only workaround for this is to work with smaller result sets.

Throws:
SQLException - if an error occurs. SQLSTATE HY109 is thrown if this is a forward-only result set.

beforeFirst

public void beforeFirst()
                 throws SQLException
Positions the cursor before the beginning of the result set.

Throws:
SQLException - if an error occurs. SQLSTATE HY109 is thrown if this is a forward-only result set.

clearWarnings

public void clearWarnings()
                   throws SQLException
Clears all warnings reported on the object.

Throws:
SQLException - if an error occurs.

close

public void close()
           throws SQLException
Closes the statement.

Throws:
SQLException - if an error occurs.

findColumn

public int findColumn(java.lang.String columnName)
               throws SQLException
Finds a column index from a column name.

Parameters:
columnName - The column name.
Returns:
The column index.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the result set is not open. 07009 is thrown if the column name doesn't exist.

first

public boolean first()
              throws SQLException
Positions the cursor at the first row of the result set.

Returns:
True if the cursor is on a valid row.
Throws:
SQLException - if an error occurs. SQLSTATE HY109 is thrown if this is a forward-only result set.

getAsciiStream

public java.io.InputStream getAsciiStream(int columnIndex)
                                   throws SQLException
Returns an ascii stream representing the result set column.

Performance consideration: When calling this method on a CLOB or NCLOB server column, this call makes a separate server call to retrieve the object. This is different from all other data types, since they are fully transferred to the client no later when the cursor is moved to the current column. If you only wish to keep a reference to the CLOB or NCLOB for later use, please consider using the ResultSet.getClob since this only returns a LOCATOR reference to the object, and no server calls are being made.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 08S01 is thrown on a network receive error. 2200G is thrown if the column type wasn't castable to a string, see {link #ResultSetTypeCasting} for an overview of which column types are castable to which Java types.
See Also:
getClob(int)

getAsciiStream

public java.io.InputStream getAsciiStream(java.lang.String columnName)
                                   throws SQLException
Returns an ascii stream representing the result set column.

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist. 08S01 is thrown on a network receive error. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getBinaryStream

public java.io.InputStream getBinaryStream(int columnIndex)
                                    throws SQLException
Returns an binary stream representing the result set column.

Performance consideration: When calling this method on a BLOB server column, this call makes a separate server call to retrieve the BLOB. This is different from all other data types, since they are fully transferred to the client no later when the cursor is moved to the current column. If you only wish to keep a reference to the BLOB for later use, please consider using the ResultSet.getBlob since this only returns a LOCATOR reference to the object, and no server calls are being made.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 08S01 is thrown on a network receive error. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.
See Also:
getBlob(int)

getBinaryStream

public java.io.InputStream getBinaryStream(java.lang.String columnName)
                                    throws SQLException
Returns an binary stream representing the result set column.

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist. 08S01 is thrown on a network receive error. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getBlob

public Blob getBlob(int columnIndex)
             throws SQLException
Get a BLOB LOCATOR object.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid.

getBlob

public Blob getBlob(java.lang.String columnName)
             throws SQLException
Get a BLOB LOCATOR object.

Parameters:
columnName - The column name..
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist.

getBoolean

public boolean getBoolean(int columnIndex)
                   throws SQLException
Returns a boolean.

If the column is a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING, this returns true if the character has the values "true" or "1".

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getBoolean

public boolean getBoolean(java.lang.String columnName)
                   throws SQLException
Returns a boolean.

If the column is a CHARACTER, CHARACTER VARYING, NATIONAL CHARACTER or NATIONAL CHARACTER VARYING, this returns true if the character has the values "true" or "1".

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getByte

public byte getByte(int columnIndex)
             throws SQLException
Returns a byte.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 22003 is thrown if the numeric value could not be fitted into a byte. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getByte

public byte getByte(java.lang.String columnName)
             throws SQLException
Returns a byte.

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist. 22003 is thrown if the numeric value could not be fitted into a byte. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getBytes

public byte[] getBytes(int columnIndex)
                throws SQLException
Returns an array of bytes.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 08S01 is thrown on a network receive error. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getBytes

public byte[] getBytes(java.lang.String columnName)
                throws SQLException
Returns an array of bytes.

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist. 08S01 is thrown on a network receive error. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getCharacterStream

public java.io.Reader getCharacterStream(int columnIndex)
                                  throws SQLException
Get a character stream.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 08S01 is thrown on a network receive error.

getCharacterStream

public java.io.Reader getCharacterStream(java.lang.String columnName)
                                  throws SQLException
Get a character stream.

Parameters:
columnName - The column name..
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist. 08S01 is thrown on a network receive error.

getClob

public Clob getClob(int columnIndex)
             throws SQLException
Get a CLOB LOCATOR object.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid.

getClob

public Clob getClob(java.lang.String columnName)
             throws SQLException
Get a CLOB LOCATOR object.

Parameters:
columnName - The column name..
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist.

getConcurrency

public int getConcurrency()
                   throws SQLException
Returns the concurrency mode for this result set.

Returns:
The concurrency mode.
Throws:
SQLException - if an error occurs.

getCursorName

public java.lang.String getCursorName()
                               throws SQLException
Returns the name of this cursor.

The name of the cursor can be used in conjunction with the UPDATE WHERE CURRENT OF or DELETE WHERE CURRENT OF SQL statements. See Statement.setCursorName for more information on this feature.

Returns:
The cursor name.
Throws:
SQLException - if an error occurs.
See Also:
Statement.setCursorName(java.lang.String)

getFetchDirection

public int getFetchDirection()
                      throws SQLException
Gets the current fetch direction hint.

Returns:
The fetch direction hint.
Throws:
SQLException - if an error occurs.
See Also:
setFetchDirection(int)

getFetchSize

public int getFetchSize()
                 throws SQLException
Retrieves the current fetch size. A value of 0 implies that the driver uses an appropriate fetch size of its on choice.

Returns:
The fetch size.
Throws:
SQLException - if an error occurs.
See Also:
setFetchSize(int)

getInt

public int getInt(int columnIndex)
           throws SQLException
Returns an integer.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 22003 is thrown if the numeric value could not be fitted into an int. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getInt

public int getInt(java.lang.String columnName)
           throws SQLException
Returns an integer.

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 22003 is thrown if the numeric value could not be fitted into an int. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getLong

public long getLong(int columnIndex)
             throws SQLException
Returns an long.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 22003 is thrown if the numeric value could not be fitted into an long. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getLong

public long getLong(java.lang.String columnName)
             throws SQLException
Returns an long.

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 22003 is thrown if the numeric value could not be fitted into an long. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the column type wasn't castable to a string, see ResultSet for an overview of which column types are castable to which Java types.

getMetaData

public ResultSetMetaData getMetaData()
                              throws SQLException
Returns a ResultSetMetaData object describing the result set.

A ResultSetMetaData object is always internally created at the same time the ResultSet object is created. The driver must have this information somewhere to return data from the result set. This method simply returns this object.

Returns:
The ResultSetMetaData object.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open.

getObject

public java.lang.Object getObject(int columnIndex)
                           throws SQLException
Returns an object.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is not valid.

getObject

public java.lang.Object getObject(java.lang.String columnName)
                           throws SQLException
Returns an object.

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist.

getRow

public int getRow()
           throws SQLException
Return the current row number.

Returns:
The row number.
Throws:
SQLException - if an error occurs.

getShort

public short getShort(int columnIndex)
               throws SQLException
Returns a short.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid. 22003 is thrown if the numeric value could not be fitted into an short. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the column type wasn't castable to a short, see ResultSet for an overview of which column types are castable to which Java types.

getShort

public short getShort(java.lang.String columnName)
               throws SQLException
Returns a short.

Parameters:
columnName - The column name.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName is invalid. 22003 is thrown if the numeric value could not be fitted into an short. 22018 is thrown if a character value could not be casted to a numeric value. 2200G is thrown if the column type wasn't castable to a short, see ResultSet for an overview of which column types are castable to which Java types.

getStatement

public Statement getStatement()
                       throws SQLException
Get the statement that belongs to this result set.

Returns:
The statement.
Throws:
SQLException - if an error occurs.

getString

public java.lang.String getString(int columnIndex)
                           throws SQLException
Returns a string.

Parameters:
columnIndex - The column number.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnIndex is invalid.

getString

public java.lang.String getString(java.lang.String columnName)
                           throws SQLException
Returns a string.

Parameters:
columnName - The column name..
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 24000 is thrown if the cursor is not located on a valid row. 07009 is thrown if the columnName does not exist.

getType

public int getType()
            throws SQLException
Return the type of the result set.

Returns:
The result set type.
Throws:
SQLException - if an error occurs.

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
Returns the first warning posted to this object.

Returns:
The first warning object or null if no warnings available.
Throws:
SQLException - if an error occurred.
See Also:
clearWarnings()

isAfterLast

public boolean isAfterLast()
                    throws SQLException
Returns true if the current row is after the last row of the result set.

Returns:
True if current is after last.
Throws:
SQLException - if an error occurs.

isBeforeFirst

public boolean isBeforeFirst()
                      throws SQLException
Returns true if the current row is before the first row of the result set.

Returns:
True if current is before first.
Throws:
SQLException - if an error occurs.

isFirst

public boolean isFirst()
                throws SQLException
Returns true if the current row is at the first row of the result set.

Returns:
True if current is at first.
Throws:
SQLException - if an error occurs.

isLast

public boolean isLast()
               throws SQLException
Returns true if the current row is at the last row of the result set.

Returns:
True if current is at last.
Throws:
SQLException - if an error occurs.

last

public boolean last()
             throws SQLException
Positions the cursor on the last row of the result set.

Performance consideration: If the end of result set hasn't been formed before, this operation may take some time since all rows up until the end of the result set has be formed on the server. The only workaround for this is to work with smaller result sets.

Returns:
True if the cursor is on a valid row.
Throws:
SQLException - if an error occurs. SQLSTATE HY109 is thrown if this is a forward-only result set.

next

public boolean next()
             throws SQLException
Moves on to the next row in the result set.

Returns:
true if the cursor is located on a valid row after the operation.
Throws:
SQLException - if an error occurs. SQLSTATE HY010 is thrown if the cursor is not open. 08S01 is thrown on a network receive error.
See Also:
previous(), absolute(int), first(), last()

previous

public boolean previous()
                 throws SQLException
Positions the cursor one row backwards in the result set.

Returns:
True if the cursor is on a valid row.
Throws:
SQLException - if an error occurs. SQLSTATE HY109 is thrown if this is a forward-only result set.

relative

public boolean relative(int rows)
                 throws SQLException
Positioning relative to the current cursor position.

Parameters:
rows - If positive the cursor is repositioned forward in the result set. If negative it is repositioned backwards.
Throws:
SQLException - if an error occurs. SQLSTATE HY109 is thrown if this is a forward-only result set.

setFetchDirection

public void setFetchDirection(int direction)
                       throws SQLException
Sets the current fetch direction hint.

See Statement.setFetchDirection for a deeper descissuion on fetch direction and Mimer SQL.

Parameters:
direction - The fetch direction hint.
Throws:
SQLException - if an error occurs. If the Statement object is closed, SQLSTATE HY010 is thrown. If the fetch direction is illegal HY024 is thrown.
See Also:
Statement.setFetchDirection(int), getFetchDirection()

setFetchSize

public void setFetchSize(int rows)
                  throws SQLException
Sets the current fetch size.

See Statement.setFetchSize for a deeper descissuion on fetch size and Mimer SQL.

Parameters:
rows - The fetch size.
Throws:
SQLException - if an error occurs. If the Statement object is closed, SQLSTATE HY010 is thrown. HY024 is thrown if the fetch size is negative.
See Also:
Statement.setMaxRows(int), Statement.setFetchSize(int), getFetchSize()

wasNull

public boolean wasNull()
                throws SQLException
Returns true if the last column read was a NULL.

Returns:
true if SQL NULL.
Throws:
SQLException - if an error occurs.

Mimer JDBC/MIDP 2.12

Submit a comment or suggestion Version 2.12 of Mimer JDBC for the CLDC/MID Profile Specification
Copyright Upright Database Technology AB, Box 1713, SE-751 47 UPPSALA, Sweden. All Rights Reserved.