summaryrefslogtreecommitdiff
path: root/java/sql
diff options
context:
space:
mode:
authorWarren Levy <warrenl@redhat.com>2000-06-29 23:20:33 +0000
committerWarren Levy <warrenl@redhat.com>2000-06-29 23:20:33 +0000
commitd87a15cc0076071bc4501bbeece802e1b8616585 (patch)
treea91f4394b934a32b48fb1683af562852cc2a5223 /java/sql
parenta40aa46838c98db56191e72ceef41d471ed4ed0d (diff)
downloadclasspath-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')
-rw-r--r--java/sql/Connection.java4
-rw-r--r--java/sql/DatabaseMetaData.java19
-rw-r--r--java/sql/Driver.java4
-rw-r--r--java/sql/PreparedStatement.java72
4 files changed, 79 insertions, 20 deletions
diff --git a/java/sql/Connection.java b/java/sql/Connection.java
index 0efa4f4aa..993c1f66f 100644
--- a/java/sql/Connection.java
+++ b/java/sql/Connection.java
@@ -1,5 +1,5 @@
/* Connection.java -- Manage a database connection.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -74,7 +74,7 @@ public static final int TRANSACTION_REPEATABLE_READ = 4;
* transactions will not affect the result set returned during subsequent
* executions of the same WHERE clause in this transaction.
*/
-public static final int TRANSACTION_SERIALIZEABLE = 8;
+public static final int TRANSACTION_SERIALIZABLE = 8;
/*************************************************************************/
diff --git a/java/sql/DatabaseMetaData.java b/java/sql/DatabaseMetaData.java
index c4a1aa77f..59273f29d 100644
--- a/java/sql/DatabaseMetaData.java
+++ b/java/sql/DatabaseMetaData.java
@@ -1,5 +1,5 @@
/* DatabaseMetaData.java -- Information about the database itself.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -592,7 +592,7 @@ storesMixedCaseQuotedIdentifiers() throws SQLException;
* @exception SQLException If an error occurs.
*/
public abstract String
-getIdentiferQuoteString() throws SQLException;
+getIdentifierQuoteString() throws SQLException;
/*************************************************************************/
@@ -646,14 +646,14 @@ getSystemFunctions() throws SQLException;
/*************************************************************************/
/**
- * This method returns comma separated list of date/time functions.
+ * This method returns comma separated list of time/date functions.
*
- * @return The list of date/time functions.
+ * @return The list of time/date functions.
*
* @exception SQLException If an error occurs.
*/
public abstract String
-getDateTimeFunctions() throws SQLException;
+getTimeDateFunctions() throws SQLException;
/*************************************************************************/
@@ -1251,7 +1251,7 @@ supportsCatalogsInIndexDefinitions() throws SQLException;
* @exception SQLException If an error occurs.
*/
public abstract boolean
-supportsCatalogInPrivilegeDefinitions() throws SQLException;
+supportsCatalogsInPrivilegeDefinitions() throws SQLException;
/*************************************************************************/
@@ -1719,7 +1719,7 @@ getMaxTablesInSelect() throws SQLException;
* @exception SQLException If an error occurs.
*/
public abstract int
-getMaxTableUserLength() throws SQLException;
+getMaxUserNameLength() throws SQLException;
/*************************************************************************/
@@ -1925,14 +1925,15 @@ getProcedureColumns(String catalog, String schemaPattern, String namePattern,
* @param schemaPattern A schema pattern for the schemas to return tables
* from, or "" to return tables from all schemas.
* @param namePattern The pattern of table names to return.
+ * @param types The list of table types to include; null returns all types.
*
* @returns A <code>ResultSet</code> with all the requested tables.
*
* @exception SQLException If an error occurs.
*/
public abstract ResultSet
-getTables(String catalog, String schemaPattern, String namePattern)
- throws SQLException;
+getTables(String catalog, String schemaPattern, String namePattern,
+ String types[]) throws SQLException;
/*************************************************************************/
diff --git a/java/sql/Driver.java b/java/sql/Driver.java
index 18e817a93..0ae0da7fd 100644
--- a/java/sql/Driver.java
+++ b/java/sql/Driver.java
@@ -1,5 +1,5 @@
/* Driver.java -- A JDBC driver
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ public abstract interface Driver
* @return The major version number of the driver.
*/
public abstract int
-getMajorVersionNumber();
+getMajorVersion();
/*************************************************************************/
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