From f8ef12439c28831e6d0f75a551c0c746df627b08 Mon Sep 17 00:00:00 2001 From: "Aaron M. Renn" Date: Sun, 17 Jan 1999 20:39:11 +0000 Subject: Initial Checkin --- java/sql/Ref.java | 45 ++ java/sql/ResultSet.java | 1994 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2039 insertions(+) create mode 100644 java/sql/Ref.java create mode 100644 java/sql/ResultSet.java (limited to 'java/sql') diff --git a/java/sql/Ref.java b/java/sql/Ref.java new file mode 100644 index 000000000..b4d6d0eb8 --- /dev/null +++ b/java/sql/Ref.java @@ -0,0 +1,45 @@ +/************************************************************************* +/* Ref.java -- Reference to a SQL structured type. +/* +/* Copyright (c) 1999 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) +/* +/* This library is free software; you can redistribute it and/or modify +/* it under the terms of the GNU Library General Public License as published +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later verion. +/* +/* This library is distributed in the hope that it will be useful, but +/* WITHOUT ANY WARRANTY; without even the implied warranty of +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/* GNU Library General Public License for more details. +/* +/* You should have received a copy of the GNU Library General Public License +/* along with this library; if not, write to the Free Software Foundation +/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA +/*************************************************************************/ + +package java.sql; + +/** + * This interface provides a mechanism for obtaining information about + * a SQL structured type + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public abstract interface Ref +{ + +/** + * This method returns the fully qualified name of the SQL structured + * type of the referenced item. + * + * @return The fully qualified name of the SQL structured type. + * + * @exception SQLException If an error occurs. + */ +public abstract String +getBaseTypeName() throws SQLException; + +} // interface Ref + diff --git a/java/sql/ResultSet.java b/java/sql/ResultSet.java new file mode 100644 index 000000000..581cbdf92 --- /dev/null +++ b/java/sql/ResultSet.java @@ -0,0 +1,1994 @@ +/************************************************************************* +/* ResultSet.java -- A SQL statement result set. +/* +/* Copyright (c) 1999 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) +/* +/* This library is free software; you can redistribute it and/or modify +/* it under the terms of the GNU Library General Public License as published +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later verion. +/* +/* This library is distributed in the hope that it will be useful, but +/* WITHOUT ANY WARRANTY; without even the implied warranty of +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/* GNU Library General Public License for more details. +/* +/* You should have received a copy of the GNU Library General Public License +/* along with this library; if not, write to the Free Software Foundation +/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA +/*************************************************************************/ + +package java.sql; + +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Map; + +/** + * This interface provides access to the data set returned by a SQL + * statement. An instance of this interface is returned by the various + * execution methods in the Statement + * This class models a cursor, which can be stepped through one row at a + * time. Methods are provided for accessing columns by column name or by + * index. + *

+ * Note that a result set is invalidated if the statement that returned + * it is closed. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public abstract interface ResultSet +{ + +/** + * The rows will be processed in order from first to last. + */ +public static final int FETCH_FORWARD = 0; + +/** + * The rows will be processed in order from last to first. + */ +public static final int FETCH_REVERSE = 1; + +/** + * The rows will be processed in an unknown order + */ +public static final int FETCH_UNKNOWN = 2; + +/** + * This type of result set may only step forward through the rows returned. + */ +public static final int TYPE_FORWARD_ONLY = 0; + +/** + * This type of result set is scrollable and is not sensitive to changes + * made by other statements. + */ +public static final int TYPE_SCROLL_INSENSITIVE = 1; + +/** + * This type of result set is scrollable and is also sensitive to changes + * made by other statements. + */ +public static final int TYPE_SCROLL_SENSITIVE = 1; + +/** + * The concurrency mode of for the result set may not be modified. + */ +public static final int CONCUR_READ_ONLY = 0; + +/** + * The concurrency mode of for the result set may be modified. + */ +public static final int CONCUR_UPDATABLE = 1; + +/*************************************************************************/ + +/** + * This method advances to the next row in the result set. Any streams + * open on the current row are closed automatically. + * + * @return true if the next row exists, false + * otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +next() throws SQLException; + +/*************************************************************************/ + +/** + * This method moves the current position to the previous row in the + * result set. + * + * @return true if the previous row exists, false + * otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +previous() throws SQLException; + +/*************************************************************************/ + +/** + * This method closes the result set and frees any associated resources. + * + * @exception SQLException If an error occurs. + */ +public abstract void +close() throws SQLException; + +/*************************************************************************/ + +/** + * This method tests whether the value of the last column that was fetched + * was actually a SQL NULL value. + * + * @return true if the last column fetched was a NULL, + * false otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +wasNull() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * String. + * + * @param index The index of the column to return. + * + * @return The column value as a String. + * + * @exception SQLException If an error occurs. + */ +public abstract String +getString(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * Object. + * + * @param index The index of the column to return. + * + * @return The column value as an Object. + * + * @exception SQLException If an error occurs. + */ +public abstract Object +getObject(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * boolean. + * + * @param index The index of the column to return. + * + * @return The column value as a boolean. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +getBoolean(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * byte. + * + * @param index The index of the column to return. + * + * @return The column value as a byte. + * + * @exception SQLException If an error occurs. + */ +public abstract byte +getByte(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * short. + * + * @param index The index of the column to return. + * + * @return The column value as a short. + * + * @exception SQLException If an error occurs. + */ +public abstract short +getShort(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * int. + * + * @param index The index of the column to return. + * + * @return The column value as a int. + * + * @exception SQLException If an error occurs. + */ +public abstract int +getInt(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * long. + * + * @param index The index of the column to return. + * + * @return The column value as a long. + * + * @exception SQLException If an error occurs. + */ +public abstract long +getLong(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * float. + * + * @param index The index of the column to return. + * + * @return The column value as a float. + * + * @exception SQLException If an error occurs. + */ +public abstract float +getFloat(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * double. + * + * @param index The index of the column to return. + * + * @return The column value as a double. + * + * @exception SQLException If an error occurs. + */ +public abstract double +getDouble(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * BigDecimal. + * + * @param index The index of the column to return. + * + * @return The column value as a BigDecimal. + * + * @exception SQLException If an error occurs. + */ +public abstract BigDecimal +getBigDecimal(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * BigDecimal. + * + * @param index The index of the column to return. + * @param scale The number of digits to the right of the decimal to return. + * + * @return The column value as a BigDecimal. + * + * @exception SQLException If an error occurs. + */ +public abstract BigDecimal +getBigDecimal(int index, int scale) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * byte array. + * + * @param index The index of the column to return. + * + * @return The column value as a byte array + * + * @exception SQLException If an error occurs. + */ +public abstract byte[] +getBytes(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * java.sql.Date. + * + * @param index The index of the column to return. + * + * @return The column value as a java.sql.Date. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Date +getDate(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * java.sql.Time. + * + * @param index The index of the column to return. + * + * @return The column value as a java.sql.Time. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Time +getTime(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * java.sql.Timestamp. + * + * @param index The index of the column to return. + * + * @return The column value as a java.sql.Timestamp. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Timestamp +getTimestamp(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as an ASCII + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param index The index of the column to return. + * + * @return The column value as an ASCII InputStream. + * + * @exception SQLException If an error occurs. + */ +public abstract InputStream +getAsciiStream(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Unicode UTF-8 + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param index The index of the column to return. + * + * @return The column value as a Unicode UTF-8 InputStream. + * + * @exception SQLException If an error occurs. + */ +public abstract InputStream +getUnicodeStream(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a raw byte + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param index The index of the column to return. + * + * @return The column value as a raw byte InputStream. + * + * @exception SQLException If an error occurs. + */ +public abstract InputStream +getBinaryStream(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a character + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param index The index of the column to return. + * + * @return The column value as an character Reader. + * + * @exception SQLException If an error occurs. + */ +public abstract Reader +getCharacterStream(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * String. + * + * @param column The name of the column to return. + * + * @return The column value as a String. + * + * @exception SQLException If an error occurs. + */ +public abstract String +getString(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * Object. + * + * @param column The name of the column to return. + * + * @return The column value as an Object. + * + * @exception SQLException If an error occurs. + */ +public abstract Object +getObject(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * boolean. + * + * @param column The name of the column to return. + * + * @return The column value as a boolean. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +getBoolean(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * byte. + * + * @param column The name of the column to return. + * + * @return The column value as a byte. + * + * @exception SQLException If an error occurs. + */ +public abstract byte +getByte(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * short. + * + * @param column The name of the column to return. + * + * @return The column value as a short. + * + * @exception SQLException If an error occurs. + */ +public abstract short +getShort(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * int. + * + * @param column The name of the column to return. + * + * @return The column value as a int. + * + * @exception SQLException If an error occurs. + */ +public abstract int +getInt(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * long. + * + * @param column The name of the column to return. + * + * @return The column value as a long. + * + * @exception SQLException If an error occurs. + */ +public abstract long +getLong(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * float. + * + * @param column The name of the column to return. + * + * @return The column value as a float. + * + * @exception SQLException If an error occurs. + */ +public abstract float +getFloat(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * double. + * + * @param column The name of the column to return. + * + * @return The column value as a double. + * + * @exception SQLException If an error occurs. + */ +public abstract double +getDouble(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * BigDecimal. + * + * @param column The name of the column to return. + * + * @return The column value as a BigDecimal. + * + * @exception SQLException If an error occurs. + */ +public abstract BigDecimal +getBigDecimal(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * BigDecimal. + * + * @param column The name of the column to return. + * @param scale The number of digits to the right of the decimal to return. + * + * @return The column value as a BigDecimal. + * + * @exception SQLException If an error occurs. + */ +public abstract BigDecimal +getBigDecimal(String column, int scale) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * byte array. + * + * @param column The name of the column to return. + * + * @return The column value as a byte array + * + * @exception SQLException If an error occurs. + */ +public abstract byte[] +getBytes(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * java.sql.Date. + * + * @param column The name of the column to return. + * + * @return The column value as a java.sql.Date. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Date +getDate(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * java.sql.Time. + * + * @param column The name of the column to return. + * + * @return The column value as a java.sql.Time. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Time +getTime(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * java.sql.Timestamp. + * + * @param column The name of the column to return. + * + * @return The column value as a java.sql.Timestamp. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Timestamp +getTimestamp(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as an ASCII + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param column The name of the column to return. + * + * @return The column value as an ASCII InputStream. + * + * @exception SQLException If an error occurs. + */ +public abstract InputStream +getAsciiStream(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Unicode UTF-8 + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param column The name of the column to return. + * + * @return The column value as a Unicode UTF-8 InputStream. + * + * @exception SQLException If an error occurs. + */ +public abstract InputStream +getUnicodeStream(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a raw byte + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param column The name of the column to return. + * + * @return The column value as a raw byte InputStream. + * + * @exception SQLException If an error occurs. + */ +public abstract InputStream +getBinaryStream(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a character + * stream. Note that all the data from this stream must be read before + * fetching the value of any other column. Please also be aware that + * calling next() or close() on this result set + * will close this stream as well. + * + * @param column The name of the column to return. + * + * @return The column value as an character Reader. + * + * @exception SQLException If an error occurs. + */ +public abstract Reader +getCharacterStream(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the first SQL warning associated with this result + * set. Any additional warnings will be chained to this one. + * + * @return The first SQLWarning for this result set, or null if + * there are no warnings. + * + * @exception SQLException If an error occurs. + */ +public abstract SQLWarning +getWarnings() throws SQLException; + +/*************************************************************************/ + +/** + * This method clears all warnings associated with this result set. + * + * @exception SQLException If an error occurs. + */ +public abstract void +clearWarnings() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the name of the database cursor used by this + * result set. + * + * @return The name of the database cursor used by this result set. + * + * @exception SQLException If an error occurs. + */ +public abstract String +getCursorName() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns data about the columns returned as part of the + * result set as a ResultSetMetaData instance. + * + * @return The ResultSetMetaData instance for this result set. + * + * @exception SQLException If an error occurs. + */ +public abstract ResultSetMetaData +getMetaData() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the column index of the specified named column. + * + * @param column The name of the column. + * + * @return The index of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract int +findColumn(String column) throws SQLException; + +/*************************************************************************/ + +/** + * This method tests whether or not the cursor is before the first row + * in the result set. + * + * @return true if the cursor is positioned before the first + * row, false otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +isBeforeFirst() throws SQLException; + +/*************************************************************************/ + +/** + * This method tests whether or not the cursor is after the last row + * in the result set. + * + * @return true if the cursor is positioned after the last + * row, false otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +isAfterLast() throws SQLException; + +/*************************************************************************/ + +/** + * This method tests whether or not the cursor is positioned on the first + * row in the result set. + * + * @return true if the cursor is positioned on the first + * row, false otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +isFirst() throws SQLException; + +/*************************************************************************/ + +/** + * This method tests whether or not the cursor is on the last row + * in the result set. + * + * @return true if the cursor is positioned on the last + * row, false otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +isLast() throws SQLException; + +/*************************************************************************/ + +/** + * This method repositions the cursor to before the first row in the + * result set. + * + * @exception SQLException If an error occurs. + */ +public abstract void +beforeFirst() throws SQLException; + +/*************************************************************************/ + +/** + * This method repositions the cursor to after the last row in the result + * set. + * + * @exception SQLException If an error occurs. + */ +public abstract void +afterLast() throws SQLException; + +/*************************************************************************/ + +/** + * This method repositions the cursor on the first row in the + * result set. + * + * @exception SQLException If an error occurs. + */ +public abstract void +first() throws SQLException; + +/*************************************************************************/ + +/** + * This method repositions the cursor on the last row in the result + * set. + * + * @exception SQLException If an error occurs. + */ +public abstract void +last() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the current row number in the cursor. Numbering + * begins at index 1. + * + * @return The current row number, or 0 if there is not current row. + * + * @exception SQLException If an error occurs. + */ +public abstract int +getRow() throws SQLException; + +/*************************************************************************/ + +/** + * This method positions the result set to the specified absolute row. + * Positive numbers are row offsets from the beginning of the result + * set (numbering starts from row 1) and negative numbers are row offsets + * from the end of the result set (numbering starts from -1). + * + * @param row The row to position the result set to. + * + * @return true if the current position was changed, + * false otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +absolute(int row) throws SQLException; + +/*************************************************************************/ + +/** + * This method moves the result set position relative to the current row. + * The offset can be positive or negative. + * + * @param row The relative row position to move to. + * + * @return true if the current position was changed, + * false otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +relative(int row) throws SQLException; + +/*************************************************************************/ + +/** + * This method provides a hint to the driver about which direction the + * result set will be processed in. + * + * @param direction The direction in which rows will be processed. (Values?) + * + * @exception SQLException If an error occurs. + */ +public abstract void +setFetchDirection(int direction) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the current fetch direction for this result set. + * + * @return The fetch direction for this result set. + * + * @exception SQLException If an error occurs. + */ +public abstract int +getFetchDirection() throws SQLException; + +/*************************************************************************/ + +/** + * This method provides a hint to the driver about how many rows at a + * time it should fetch from the database. + * + * @param rows The number of rows the driver should fetch per call. + * + * @exception SQLException If an error occurs. + */ +public abstract void +setFetchSize(int rows) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the current number of rows that will be fetched + * from the database at a time. + * + * @return The current fetch size for this result set. + * + * @exception SQLException If an error occurs. + */ +public abstract int +getFetchSize() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the result set type of this result set. This will + * be one of the TYPE_* constants defined in this interface. + * + * @return The result set type. + * + * @exception SQLException If an error occurs. + */ +public abstract int +getType() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the concurrency type of this result set. This will + * be one of the CONCUR_* constants defined in this interface. + * + * @return The result set concurrency type. + * + * @exception SQLException If an error occurs. + */ +public abstract int +getConcurrency() throws SQLException; + +/*************************************************************************/ + +/** + * This method tests whether or not the current row in the result set + * has been updated. Updates must be visible in order of this method to + * detect the update. + * + * @return true if the row has been updated, false + * otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +rowUpdated() throws SQLException; + +/*************************************************************************/ + +/** + * This method tests whether or not the current row in the result set + * has been inserted. Inserts must be visible in order of this method to + * detect the insert. + * + * @return true if the row has been inserted, false + * otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +rowInserted() throws SQLException; + +/*************************************************************************/ + +/** + * This method tests whether or not the current row in the result set + * has been deleted. Deletes must be visible in order of this method to + * detect the deletion. + * + * @return true if the row has been deleted, false + * otherwise. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +rowDeleted() throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a NULL value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @return index The index of the column to update. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateNull(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a boolean value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateBoolean(int index, boolean value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a byte value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateByte(int index, byte value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a short value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateShort(int index, short value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have an int value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateInt(int index, int value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a long value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateLong(int index, long value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a float value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateFloat(int index, float value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a double value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateDouble(int index, double value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a BigDecimal value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateBigDecimal(int index, BigDecimal value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a String value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateString(int index, String value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a byte array value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateBytes(int index, byte[] value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a java.sql.Date value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateDate(int index, java.sql.Date value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a java.sql.Time value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateTime(int index, java.sql.Time value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a java.sql.Timestamp value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateTimestamp(int index, java.sql.Timestamp value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column from an ASCII text stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateAsciiStream(int index, InputStream value, int length) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column from a binary stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateBinaryStream(int index, InputStream value, int length) + throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column from a character stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateCharacterStream(int index, Reader value, int length) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have an Object value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateObject(int index, Object value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have an Object value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param index The index of the column to update. + * @param value The new value of the column. + * @param scale The scale of the object in question, which is used only + * for numeric type objects. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateObject(int index, Object value, int scale) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a NULL value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @return name The name of the column to update. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateNull(String name) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a boolean value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateBoolean(String name, boolean value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a byte value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateByte(String name, byte value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a short value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateShort(String name, short value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have an int value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateInt(String name, int value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a long value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateLong(String name, long value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a float value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateFloat(String name, float value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a double value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateDouble(String name, double value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a BigDecimal value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateBigDecimal(String name, BigDecimal value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a String value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateString(String name, String value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a byte array value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateBytes(String name, byte[] value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a java.sql.Date value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateDate(String name, java.sql.Date value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a java.sql.Time value. This + * does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateTime(String name, java.sql.Time value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have a java.sql.Timestamp value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateTimestamp(String name, java.sql.Timestamp value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column from an ASCII text stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateAsciiStream(String name, InputStream value, int length) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column from a binary stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateBinaryStream(String name, InputStream value, int length) + throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column from a character stream. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @param length The length of the stream. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateCharacterStream(String name, Reader value, int length) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have an Object value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateObject(String name, Object value) throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the specified column to have an Object value. + * This does not update the actual database. updateRow must be + * called in order to do that. + * + * @param name The name of the column to update. + * @param value The new value of the column. + * @param scale The scale of the object in question, which is used only + * for numeric type objects. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateObject(String name, Object value, int scale) throws SQLException; + +/*************************************************************************/ + +/** + * This method inserts the current row into the database. The result set + * must be positioned on the insert row in order to call this method + * successfully. + * + * @exception SQLException If an error occurs. + */ +public abstract void +insertRow() throws SQLException; + +/*************************************************************************/ + +/** + * This method updates the current row in the database. + * + * @exception SQLException If an error occurs. + */ +public abstract void +updateRow() throws SQLException; + +/*************************************************************************/ + +/** + * This method deletes the current row in the database. + * + * @exception SQLException If an error occurs. + */ +public abstract void +deleteRow() throws SQLException; + +/*************************************************************************/ + +/** + * This method refreshes the contents of the current row from the database. + * + * @exception SQLException If an error occurs. + */ +public abstract void +refreshRow() throws SQLException; + +/*************************************************************************/ + +/** + * This method cancels any changes that have been made to a row. If + * the rowUpdate method has been called, then the changes + * cannot be undone. + * + * @exception SQLException If an error occurs. + */ +public abstract void +cancelRowUpdates() throws SQLException; + +/*************************************************************************/ + +/** + * This method positions the result set to the "insert row", which allows + * a new row to be inserted into the database from the result set. + * + * @exception SQLException If an error occurs. + */ +public abstract void +moveToInsertRow() throws SQLException; + +/*************************************************************************/ + +/** + * This method moves the result set position from the insert row back to + * the current row that was selected prior to moving to the insert row. + * + * @exception SQLException If an error occurs. + */ +public abstract void +moveToCurrentRow() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns a the Statement that was used to + * produce this result set. + * + * @return The Statement used to produce this result set. + * + * @exception SQLException If an error occurs. + */ +public abstract Statement +getStatement() throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * Object using the specified SQL type to Java type map. + * + * @param index The index of the column to return. + * @param map The SQL type to Java type map to use. + * + * @return The value of the column as an Object. + * + * @exception SQLException If an error occurs. + */ +public abstract Object +getObject(int index, Map map) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns a Ref for the specified column which + * represents the structured type for the column. + * + * @param index The index of the column to return. + * + * @return A Ref object for the column + * + * @exception SQLException If an error occurs. + */ +public Ref +getRef(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a BLOB. + * + * @param index The index of the column value to return. + * + * @return The value of the column as a BLOB. + * + * @exception SQLException If an error occurs. + */ +public abstract Blob +getBlob(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a CLOB. + * + * @param index The index of the column value to return. + * + * @return The value of the column as a CLOB. + * + * @exception SQLException If an error occurs. + */ +public abstract Clob +getClob(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as an Array. + * + * @param index The index of the column value to return. + * + * @return The value of the column as an Array. + * + * @exception SQLException If an error occurs. + */ +public abstract Array +getArray(int index) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the value of the specified column as a Java + * Object using the specified SQL type to Java type map. + * + * @param name The name of the column to return. + * @param map The SQL type to Java type map to use. + * + * @return The value of the column as an Object. + * + * @exception SQLException If an error occurs. + */ +public abstract Object +getObject(String name, Map map) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns a Ref for the specified column which + * represents the structured type for the column. + * + * @param index The index of the column to return. + * + * @return A Ref object for the column + * + * @exception SQLException If an error occurs. + */ +public Ref +getRef(String name) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a BLOB. + * + * @param name The name of the column value to return. + * + * @return The value of the column as a BLOB. + * + * @exception SQLException If an error occurs. + */ +public abstract Blob +getBlob(String name) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a CLOB. + * + * @param name The name of the column value to return. + * + * @return The value of the column as a CLOB. + * + * @exception SQLException If an error occurs. + */ +public abstract Clob +getClob(String name) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as an Array. + * + * @param name The name of the column value to return. + * + * @return The value of the column as an Array. + * + * @exception SQLException If an error occurs. + */ +public abstract Array +getArray(String name) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a + * java.sql.Date. The specified Calendar is used + * to generate a value for the date if the database does not support + * timezones. + * + * @param index The index of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * + * @return The value of the column as a java.sql.Date. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Date +getDate(int index, Calendar cal) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a + * java.sql.Time. The specified Calendar is used + * to generate a value for the time if the database does not support + * timezones. + * + * @param index The index of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * + * @return The value of the column as a java.sql.Time. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Time +getTime(int index, Calendar cal) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a + * java.sql.Timestamp. The specified Calendar is used + * to generate a value for the timestamp if the database does not support + * timezones. + * + * @param index The index of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * + * @return The value of the column as a java.sql.Timestamp. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Timestamp +getTimestamp(int index, Calendar cal) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a + * java.sql.Date. The specified Calendar is used + * to generate a value for the date if the database does not support + * timezones. + * + * @param name The name of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * + * @return The value of the column as a java.sql.Date. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Date +getDate(String name, Calendar cal) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a + * java.sql.Time. The specified Calendar is used + * to generate a value for the time if the database does not support + * timezones. + * + * @param name The name of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * + * @return The value of the column as a java.sql.Time. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Time +getTime(String name, Calendar cal) throws SQLException; + +/*************************************************************************/ + +/** + * This method returns the specified column value as a + * java.sql.Timestamp. The specified Calendar is used + * to generate a value for the timestamp if the database does not support + * timezones. + * + * @param name The name of the column value to return. + * @param cal The Calendar to use for calculating timezones. + * + * @return The value of the column as a java.sql.Timestamp. + * + * @exception SQLException If an error occurs. + */ +public abstract java.sql.Timestamp +getTimestamp(String name, Calendar cal) throws SQLException; + +} // interface ResultSet + -- cgit v1.2.1