com.holub.database.jdbc
Class JDBCResultSet

java.lang.Object
  extended by com.holub.database.jdbc.adapters.ResultSetAdapter
      extended by com.holub.database.jdbc.JDBCResultSet
All Implemented Interfaces:
ResultSet

public class JDBCResultSet
extends ResultSetAdapter

A limited version of the result-set class. All methods not shown throw a SQLException if called. Note the the underlying table actually holds nothing but strings, so the numeric accessors (e.g. getDouble(java.lang.String)) are doing string-to-number and number-to-string conversions. These conversions might fail if the underlying String doesn't represent a number.

©2004 Allen I. Holub. All rights reserved.

This code may be used freely by yourself with the following restrictions:

  1. Your splash screen, about box, or equivalent, must include Allen Holub's name, copyright, and URL. For example:

    This program contains Allen Holub's SQL package.
    (c) 2005 Allen I. Holub. All Rights Reserved.
    http://www.holub.com


    If your program does not run interactively, then the foregoing notice must appear in your documentation.
  2. You may not redistribute (or mirror) the source code.
  3. You must report any bugs that you find to me. Use the form at http://www.holub.com/company/contact.html or send email.
  4. The software is supplied as is. Neither Allen Holub nor Holub Associates are responsible for any bugs (or any problems caused by bugs, including lost productivity or data) in any of this code.

Field Summary
 
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 Summary
JDBCResultSet(Cursor cursor)
          Wrap a result set around a Cursor.
 
Method Summary
 double getDouble(String columnName)
           
 int getInt(String columnName)
           
 long getLong(String columnName)
           
 ResultSetMetaData getMetaData()
           
 String getString(String columnName)
           
 boolean next()
           
 void updateDouble(String columnName, double value)
           
 void updateInt(String columnName, long value)
           
 void updateNull(String columnName)
           
 
Methods inherited from class com.holub.database.jdbc.adapters.ResultSetAdapter
absolute, afterLast, beforeFirst, cancelRowUpdates, checkClosed, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getLong, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getShort, getShort, getStatement, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCResultSet

public JDBCResultSet(Cursor cursor)
              throws SQLException
Wrap a result set around a Cursor. The cursor should never have been advanced; just pass this constructor the return value from Table.rows().

Throws:
SQLException
Method Detail

next

public boolean next()
Specified by:
next in interface ResultSet
Overrides:
next in class ResultSetAdapter

getString

public String getString(String columnName)
                 throws SQLException
Specified by:
getString in interface ResultSet
Overrides:
getString in class ResultSetAdapter
Throws:
SQLException

getDouble

public double getDouble(String columnName)
                 throws SQLException
Specified by:
getDouble in interface ResultSet
Overrides:
getDouble in class ResultSetAdapter
Throws:
SQLException

getInt

public int getInt(String columnName)
           throws SQLException
Specified by:
getInt in interface ResultSet
Overrides:
getInt in class ResultSetAdapter
Throws:
SQLException

getLong

public long getLong(String columnName)
             throws SQLException
Specified by:
getLong in interface ResultSet
Overrides:
getLong in class ResultSetAdapter
Throws:
SQLException

updateNull

public void updateNull(String columnName)
Specified by:
updateNull in interface ResultSet
Overrides:
updateNull in class ResultSetAdapter

updateDouble

public void updateDouble(String columnName,
                         double value)
Specified by:
updateDouble in interface ResultSet
Overrides:
updateDouble in class ResultSetAdapter

updateInt

public void updateInt(String columnName,
                      long value)

getMetaData

public ResultSetMetaData getMetaData()
                              throws SQLException
Specified by:
getMetaData in interface ResultSet
Overrides:
getMetaData in class ResultSetAdapter
Throws:
SQLException