From 49386b54ba94e937a085f9484371a383d8905f0a Mon Sep 17 00:00:00 2001 From: David Gilbert Date: Sat, 22 Apr 2006 06:16:05 +0000 Subject: 2006-04-22 Carsten Neumann * javax/sql/Array.java: Fixed eclipse API doc warnings, named method parameters consistendly, documented some methods. * java/sql/Blob.java: Likewise. * java/sql/CallableStatement.java: Likewise. * java/sql/Clob.java: Likewise. * java/sql/Connection.java: Likewise. * java/sql/DatabaseMetaData.java: Likewise. * java/sql/Date.java: Likewise. * java/sql/Driver.java: Likewise. * java/sql/PreparedStatement.java: Likewise. * java/sql/ResultSet.java: Likewise. * java/sql/ResultSetMetaData.java: Likewise. * java/sql/SQLData.java: Likewise. * java/sql/SQLOutput.java: Likewise. * java/sql/SQLWarning.java: Likewise. * java/sql/Statement.java: Likewise. * java/sql/Time.java: Likewise. * java/sql/Timestamp.java: Likewise. ---------------------------------------------------------------------- --- java/sql/Connection.java | 130 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 105 insertions(+), 25 deletions(-) (limited to 'java/sql/Connection.java') diff --git a/java/sql/Connection.java b/java/sql/Connection.java index 58a3a81de..d827e75b0 100644 --- a/java/sql/Connection.java +++ b/java/sql/Connection.java @@ -1,5 +1,5 @@ /* Connection.java -- Manage a database connection. - Copyright (C) 1999, 2000, 2002, 2006, Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -61,7 +61,7 @@ public interface Connection int TRANSACTION_READ_UNCOMMITTED = 1; /** - * This transaction isolation leve indicates that only committed data from + * This transaction isolation level indicates that only committed data from * other transactions will be read. If a transaction reads a row, then * another transaction commits a change to that row, the first transaction * would retrieve the changed row on subsequent reads of the same row. @@ -101,8 +101,8 @@ public interface Connection * SQL string. This method is designed for use with parameterized * statements. The default result set type and concurrency will be used. * - * @param sql the SQL statement to use in creating this - * PreparedStatement. + * @param sql The SQL statement to use in creating this + * PreparedStatement. * @return A new PreparedStatement. * @exception SQLException If an error occurs. * @see PreparedStatement @@ -115,8 +115,8 @@ public interface Connection * stored procedures. The default result set type and concurrency * will be used. * - * @param sql the SQL statement to use in creating this - * CallableStatement. + * @param sql The SQL statement to use in creating this + * CallableStatement. * @return A new CallableStatement. * @exception SQLException If an error occurs. * @see CallableStatement @@ -127,7 +127,7 @@ public interface Connection * This method converts the specified generic SQL statement into the * native grammer of the database this object is connected to. * - * @param sql the JDBC generic SQL statement. + * @param sql The JDBC generic SQL statement. * @return The native SQL statement. * @exception SQLException If an error occurs. */ @@ -139,7 +139,7 @@ public interface Connection * transaction must be explicitly committed or rolled back. * * @param autoCommit true to enable auto commit mode, - * false to disable it. + * false to disable it. * @exception SQLException If an error occurs. * @see #commit() * @see #rollback() @@ -152,10 +152,8 @@ public interface Connection * Otherwise a transaction must be explicitly committed or rolled back. * * @return true if auto commit mode is enabled, - * false otherwise. - * + * false otherwise. * @exception SQLException If an error occurs. - * * @see #commit() * @see #rollback() */ @@ -207,7 +205,7 @@ public interface Connection * a transaction is in progress. * * @param readOnly true if this connection is read only, - * false otherwise. + * false otherwise. * @exception SQLException If an error occurs. */ void setReadOnly(boolean readOnly) throws SQLException; @@ -235,8 +233,8 @@ public interface Connection * This method returns the name of the catalog in use by this connection, * if any. * - * @return The name of the catalog, or null if one does not - * exist or catalogs are not supported by this database. + * @return The name of the catalog, or null if none + * exists or catalogs are not supported by this database. * @exception SQLException If an error occurs. */ String getCatalog() throws SQLException; @@ -283,8 +281,8 @@ public interface Connection * ResultSet class. * * @param resultSetType The type of result set to use for this statement. - * @param resultSetConcurrency the type of concurrency to be used in - * the result set for this statement. + * @param resultSetConcurrency The type of concurrency to be used in + * the result set for this statement. * @return A new Statement object. * @exception SQLException If an error occurs. * @see Statement @@ -300,11 +298,11 @@ public interface Connection * Valid values for these parameters are specified in the * ResultSet class. * - * @param sql the SQL statement to use in creating this - * PreparedStatement. - * @param resultSetType the type of result set to use for this statement. - * @param resultSetConcurrency the type of concurrency to be used in - * the result set for this statement. + * @param sql The SQL statement to use in creating this + * PreparedStatement. + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency The type of concurrency to be used in + * the result set for this statement. * @return A new PreparedStatement. * @exception SQLException If an error occurs. * @see PreparedStatement @@ -320,11 +318,11 @@ public interface Connection * will be used. Valid values for these parameters are specified in the * ResultSet class. * - * @param sql the SQL statement to use in creating this - * PreparedStatement. + * @param sql The SQL statement to use in creating this + * PreparedStatement. * @param resultSetType The type of result set to use for this statement. - * @param resultSetConcurrency the type of concurrency to be used in - * the result set for this statement. + * @param resultSetConcurrency The type of concurrency to be used in + * the result set for this statement. * @return A new CallableStatement. * @exception SQLException If an error occurs. * @see CallableStatement @@ -353,48 +351,130 @@ public interface Connection void setTypeMap(Map map) throws SQLException; /** + * Sets the default holdability of ResultSetS that are created + * from StatementS using this Connection. + * + * @param holdability The default holdability value to set, this must be one + * of ResultSet.HOLD_CURSORS_OVER_COMMIT or + * ResultSet.CLOSE_CURSORS_AT_COMMIT. + * @exception SQLException If an error occurs. + * @see ResultSet * @since 1.4 */ void setHoldability(int holdability) throws SQLException; /** + * Gets the default holdability of ResultSetS that are created + * from StatementS using this Connection. + * + * @return The current default holdability value, this must be one of + * ResultSet.HOLD_CURSORS_OVER_COMMIT or + * ResultSet.CLOSE_CURSORS_AT_COMMIT. + * @exception SQLException If an error occurs. + * @see ResultSet * @since 1.4 */ int getHoldability() throws SQLException; /** + * Creates a new unnamed savepoint for this Connection + * + * @return The Savepoint object representing the savepoint. + * @exception SQLException If an error occurs. * @since 1.4 */ Savepoint setSavepoint() throws SQLException; /** + * Creates a new savepoint with the specifiend name for this + * Connection. + * + * @param name The name of the savepoint. + * @return The Savepoint object representing the savepoint. + * @exception SQLException If an error occurs. * @since 1.4 */ Savepoint setSavepoint(String name) throws SQLException; /** + * Undoes all changes made after the specified savepoint was set. + * + * @param savepoint The safepoint to roll back to. + * @exception SQLException If an error occurs. * @since 1.4 */ void rollback(Savepoint savepoint) throws SQLException; /** + * Removes the specified savepoint from this Connection. + * Refering to a savepoint after it was removed is an error and will throw an + * SQLException. + * + * @param savepoint The savepoint to release. + * @exception SQLException If an error occurs. * @since 1.4 */ void releaseSavepoint(Savepoint savepoint) throws SQLException; /** + * This method creates a new SQL statement with the specified type, + * concurrency and holdability, instead of using the defaults. Valid values + * for these parameters are specified in the ResultSet class. + * + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency The type of concurrency to be used in + * the result set for this statement. + * @param resultSetHoldability The type of holdability to be usd in the + * result set for this statement. + * @return A new Statement + * @exception SQLException If an error occurs. + * @see ResultSet * @since 1.4 */ Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException; /** + * This method creates a new PreparedStatement for the specified + * SQL string. This method is designed for use with parameterized + * statements. The specified result set type, concurrency and holdability + * will be used. Valid values for these parameters are specified in the + * ResultSet class. + * + * @param sql The SQL statement to use in creating this + * PreparedStatement. + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency The type of concurrency to be used in + * the result set for this statement. + * @param resultSetHoldability The type of holdability to be usd in the + * result set for this statement. + * @return A new PreparedStatement. + * @exception SQLException If an error occurs. + * @see PreparedStatement + * @see ResultSet * @since 1.4 */ PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException; /** + * This method creates a new CallableStatement for the + * specified SQL string. Thie method is designed to be used with + * stored procedures. The specified result set type, concurrency and + * holdability will be used. Valid values for these parameters are specified + * in the ResultSet class. + * + * @param sql The SQL statement to use in creating this + * PreparedStatement. + * @param resultSetType The type of result set to use for this statement. + * @param resultSetConcurrency The type of concurrency to be used in + * the result set for this statement. + * @param resultSetHoldability The type of holdability to be used in the + * result set for this statement. + * @return A new CallableStatement. + * @exception SQLException If an error occurs. + * @see CallableStatement + * @see ResultSet * @since 1.4 */ CallableStatement prepareCall(String sql, int resultSetType, int -- cgit v1.2.1