diff options
| author | Warren Levy <warrenl@redhat.com> | 2000-06-29 23:20:33 +0000 |
|---|---|---|
| committer | Warren Levy <warrenl@redhat.com> | 2000-06-29 23:20:33 +0000 |
| commit | d87a15cc0076071bc4501bbeece802e1b8616585 (patch) | |
| tree | a91f4394b934a32b48fb1683af562852cc2a5223 /java/sql/PreparedStatement.java | |
| parent | a40aa46838c98db56191e72ceef41d471ed4ed0d (diff) | |
| download | classpath-d87a15cc0076071bc4501bbeece802e1b8616585.tar.gz | |
* java/math/BigDecimal.java (add): Reimplemented.
(subtract): Corrected method name from 'substract'. Reimplemented.
* java/sql/Connection.java (TRANSACTION_SERIALIZABLE): Corrected
spelling to match JDK spec.
* java/sql/DatabaseMetaData.java (getIdentifierQuoteString):
Corrected method name from 'getIdentiferQuoteString'.
(getTimeDateFunctions): Corrected name to match the spec.
(supportsCatalogsInPrivilegeDefinitions): Ditto.
(getMaxUserNameLength): Ditto.
(getTables): Added String types[] parameter to match the spec.
* java/sql/Driver.java (getMajorVersion): Corrected method name.
* java/sql/PreparedStatement.java: Class extends Statement.
(setBigDecimal): New method.
(setAsciiStream): Added int length parameter.
(setUnicodeStream): Ditto.
(setBinaryStream): Ditto.
(setCharacterStream): Ditto.
(execute): New method.
(executeQuery): New method.
(executeUpdate): New method.
Mods to match the JDK spec (and to fix BigDecimal bugs).
Diffstat (limited to 'java/sql/PreparedStatement.java')
| -rw-r--r-- | java/sql/PreparedStatement.java | 72 |
1 files changed, 65 insertions, 7 deletions
diff --git a/java/sql/PreparedStatement.java b/java/sql/PreparedStatement.java index 14b9fe791..bce94d280 100644 --- a/java/sql/PreparedStatement.java +++ b/java/sql/PreparedStatement.java @@ -1,5 +1,5 @@ /* PreparedStatement.java -- Interface for pre-compiled statements. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -40,7 +40,7 @@ import java.util.Calendar; * * @author Aaron M. Renn (arenn@urbanophile.com) */ -public abstract interface PreparedStatement +public abstract interface PreparedStatement extends Statement { /** @@ -200,6 +200,20 @@ setBytes(int index, byte[] value) throws SQLException; /** * This method sets the specified parameter from the given Java + * <code>java.math.BigDecimal</code> value. + * + * @param index The index of the parameter value to set. + * @param value The value of the parameter. + * + * @exception SQLException If an error occurs. + */ +public abstract void +setBigDecimal(int index, java.math.BigDecimal value) throws SQLException; + +/*************************************************************************/ + +/** + * This method sets the specified parameter from the given Java * <code>java.sql.Date</code> value. * * @param index The index of the parameter value to set. @@ -292,12 +306,12 @@ setTimestamp(int index, java.sql.Timestamp value, Calendar calendar) * * @param index The index of the parameter value to set. * @param value The value of the parameter. - * @param calendar The <code>Calendar</code> to use for timezone and locale. + * @param length The number of bytes in the stream. * * @exception SQLException If an error occurs. */ public abstract void -setAsciiStream(int index, InputStream value) throws SQLException; +setAsciiStream(int index, InputStream value, int length) throws SQLException; /*************************************************************************/ @@ -307,11 +321,12 @@ setAsciiStream(int index, InputStream value) throws SQLException; * * @param index The index of the parameter value to set. * @param value The value of the parameter. + * @param length The number of bytes in the stream. * * @exception SQLException If an error occurs. */ public abstract void -setUnicodeStream(int index, InputStream value) throws SQLException; +setUnicodeStream(int index, InputStream value, int length) throws SQLException; /*************************************************************************/ @@ -321,11 +336,12 @@ setUnicodeStream(int index, InputStream value) throws SQLException; * * @param index The index of the parameter value to set. * @param value The value of the parameter. + * @param length The number of bytes in the stream. * * @exception SQLException If an error occurs. */ public abstract void -setBinaryStream(int index, InputStream value) throws SQLException; +setBinaryStream(int index, InputStream value, int length) throws SQLException; /*************************************************************************/ @@ -335,11 +351,12 @@ setBinaryStream(int index, InputStream value) throws SQLException; * * @param index The index of the parameter value to set. * @param value The value of the parameter. + * @param length The number of bytes in the stream. * * @exception SQLException If an error occurs. */ public abstract void -setCharacterStream(int index, Reader value) throws SQLException; +setCharacterStream(int index, Reader value, int length) throws SQLException; /*************************************************************************/ @@ -474,5 +491,46 @@ clearParameters() throws SQLException; public abstract ResultSetMetaData getMetaData() throws SQLException; +/*************************************************************************/ + +/** + * This method executes a prepared SQL query. + * Some prepared statements return multiple results; the execute method + * handles these complex statements as well as the simpler form of + * statements handled by executeQuery and executeUpdate. + * + * @return The result of the SQL statement. + * + * @exception SQLException If an error occurs. + */ +public abstract boolean +execute() throws SQLException; + +/*************************************************************************/ + +/** + * This method executes a prepared SQL query and returns its ResultSet. + * + * @return The ResultSet of the SQL statement. + * + * @exception SQLException If an error occurs. + */ +public abstract ResultSet +executeQuery() throws SQLException; + +/*************************************************************************/ + +/** + * This method executes an SQL INSERT, UPDATE or DELETE statement. SQL + * statements that return nothing such as SQL DDL statements can be executed. + * + * @return The result is either the row count for INSERT, UPDATE or DELETE + * statements; or 0 for SQL statements that return nothing. + * + * @exception SQLException If an error occurs. + */ +public abstract int +executeUpdate() throws SQLException; + } // interface PreparedStatement |
