//============================================================================== // ResultSetAdapter.java //============================================================================== package tribble.sql; import java.io.InputStream; import java.io.Reader; import java.lang.UnsupportedOperationException; import java.math.BigDecimal; import java.net.URL; import java.sql.Array; import java.sql.Blob; import java.sql.Clob; import java.sql.Date; import java.sql.Ref; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.SQLWarning; import java.sql.Statement; import java.sql.Time; import java.sql.Timestamp; import java.util.Calendar; import java.util.Map; /******************************************************************************* * JDBC result set adapter class. * Provides all the methods required by the java.sql.ResultSet class, * most of which do nothing but throw an UnsupportedOperationException. * Subclasses that extend this base class can then implement only the methods * that they need. * * *
*
Source code:
*
Available at: * http://david.tribble.com/src/java/tribble/sql/ResultSetAdapter.java *
*
Documentation:
*
Available at: * http://david.tribble.com/docs/tribble/sql/ResultSetAdapter.html *
*
* * * @version @(#)$Revision: 1.4 $ $Date: 2008/09/15 17:13:51 $ * @since 2008-09-02 * @author David R. Tribble (david@tribble.com) *

* Copyright ©2008 by David R. Tribble, all rights reserved.
* Permission is granted to any person or entity except those designated by * by the United States Department of State as a terrorist, or terrorist * government or agency, to use and distribute this source code provided * that the original copyright notice remains present and unaltered. */ public class ResultSetAdapter implements java.sql.ResultSet { static final String REV = "@(#)tribble/sql/ResultSetAdapter.java $Revision: 1.4 $ $Date: 2008/09/15 17:13:51 $\n"; // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // Constants /** Constant indicating that ResultSet objects should be closed * when the method Connection.commit() is called. */ public static final int CLOSE_CURSORS_AT_COMMIT = 1; /** Constant indicating that ResultSet objects should not be closed * when the method Connection.commit() is called. */ public static final int HOLD_CURSORS_OVER_COMMIT = 2; /** Constant indicating the concurrency mode for a ResultSet object * that may not be updated. */ public static final int CONCUR_READ_ONLY = 10; /** Constant indicating the concurrency mode for a ResultSet object * that may be updated. */ public static final int CONCUR_UPDATABLE = 11; /** Constant indicating that the rows in a result set will be processed in a * forward direction; first-to-last. */ public static final int FETCH_FORWARD = 20; /** Constant indicating that the rows in a result set will be processed in a * reverse direction; last-to-first. */ public static final int FETCH_REVERSE = 21; /** Constant indicating that the order in which rows in a result set will be * processed is unknown. */ public static final int FETCH_UNKNOWN = 22; /** Constant indicating the type for a ResultSet object whose * cursor may move only forward. */ public static final int TYPE_FORWARD_ONLY = 30; /** Constant indicating the type for a ResultSet object that is * scrollable but generally not sensitive to changes made by others. */ public static final int TYPE_SCROLL_INSENSITIVE = 31; /** Constant indicating the type for a ResultSet object that is * scrollable but sensitive to changes made by others. */ public static final int TYPE_SCROLL_SENSITIVE = 32; // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // Constructors /*************************************************************************** * Constructor. * * @since 1.1, 2008-09-02 */ public ResultSetAdapter() { } // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // Methods public void close() throws SQLException { } public int getType() throws SQLException { return TYPE_FORWARD_ONLY; } public int getConcurrency() throws SQLException { return CONCUR_READ_ONLY; } public boolean next() throws SQLException { return false; } public boolean previous() throws SQLException { return false; } public boolean first() throws SQLException { return false; } public boolean last() throws SQLException { return false; } public boolean absolute(int rows) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean relative(int rows) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void beforeFirst() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void afterLast() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean isFirst() throws SQLException { return false; } public boolean isLast() throws SQLException { return false; } public boolean isBeforeFirst() throws SQLException { return false; } public boolean isAfterLast() throws SQLException { return true; } public int getRow() throws SQLException { return 1; } public Statement getStatement() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getFetchSize() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getFetchDirection() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public SQLWarning getWarnings() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void clearWarnings() throws SQLException { } public ResultSetMetaData getMetaData() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void setFetchDirection(int d) throws SQLException { } public void setFetchSize(int rows) throws SQLException { } public boolean wasNull() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean rowDeleted() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean rowInserted() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean rowUpdated() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void cancelRowUpdates() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void moveToCurrentRow() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void moveToInsertRow() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void insertRow() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void refreshRow() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateRow() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void deleteRow() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateNull(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateNull(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int findColumn(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public String getCursorName() throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean getBoolean(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public boolean getBoolean(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBoolean(int col, boolean val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBoolean(String col, boolean val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public byte getByte(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public byte getByte(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateByte(int col, byte val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateByte(String col, byte val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public short getShort(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public short getShort(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateShort(int col, short val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateShort(String col, short val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getInt(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public int getInt(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateInt(int col, int val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateInt(String col, int val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public long getLong(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public long getLong(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateLong(int col, long val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateLong(String col, long val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public float getFloat(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public float getFloat(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateFloat(int col, float val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateFloat(String col, float val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public double getDouble(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public double getDouble(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateDouble(int col, double val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateDouble(String col, double val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public String getString(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public String getString(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateString(int col, String val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateString(String col, String val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Date getDate(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Date getDate(int col, Calendar cal) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Date getDate(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Date getDate(String col, Calendar cal) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateDate(int col, Date val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateDate(String col, Date val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Time getTime(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Time getTime(int col, Calendar cal) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Time getTime(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Time getTime(String col, Calendar cal) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateTime(int col, Time val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateTime(String col, Time val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Timestamp getTimestamp(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Timestamp getTimestamp(int col, Calendar cal) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Timestamp getTimestamp(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Timestamp getTimestamp(String col, Calendar cal) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateTimestamp(int col, Timestamp val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateTimestamp(String col, Timestamp val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Ref getRef(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Ref getRef(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateRef(int col, Ref val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateRef(String col, Ref val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Blob getBlob(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Blob getBlob(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBlob(int col, Blob val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBlob(String col, Blob val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Clob getClob(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Clob getClob(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateClob(int col, Clob val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateClob(String col, Clob val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Array getArray(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Array getArray(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateArray(int col, Array val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateArray(String col, Array val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public URL getURL(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public URL getURL(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateURL(int col, URL val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateURL(String col, URL val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public BigDecimal getBigDecimal(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } /** @deprecated */ public BigDecimal getBigDecimal(int col, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public BigDecimal getBigDecimal(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } /** @deprecated */ public BigDecimal getBigDecimal(String col, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBigDecimal(int col, BigDecimal val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBigDecimal(String col, BigDecimal val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Object getObject(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Object getObject(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Object getObject(int s, Map m) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Object getObject(String s, Map m) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateObject(int col, Object val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateObject(int col, Object val, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateObject(String col, Object val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateObject(String col, Object val, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public byte[] getBytes(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public byte[] getBytes(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBytes(int s, byte[] val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBytes(String s, byte[] val) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Reader getCharacterStream(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public Reader getCharacterStream(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateCharacterStream(int col, Reader in, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateCharacterStream(String col, Reader in, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public InputStream getBinaryStream(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public InputStream getBinaryStream(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBinaryStream(int col, InputStream in, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateBinaryStream(String col, InputStream in, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public InputStream getAsciiStream(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public InputStream getAsciiStream(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateAsciiStream(int col, InputStream in, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateAsciiStream(String col, InputStream in, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } /** @deprecated */ public InputStream getUnicodeStream(int col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } /** @deprecated */ public InputStream getUnicodeStream(String col) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateUnicodeStream(int col, InputStream in, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } public void updateUnicodeStream(String col, InputStream in, int n) throws SQLException { throw new UnsupportedOperationException("Not implemented"); } } // End ResultSetAdapter.java