From dffe9db25c19a7e99d3d35c535197bf7e4c15c8a Mon Sep 17 00:00:00 2001 From: Vipin Sharma Date: Fri, 2 Oct 2020 14:50:53 +0000 Subject: 8252537: Updated @exception with @throws 8252536: Replace @exception with @throws for core-libs 8252539: Replace @exception with @throws java.rmi.activation package 8252540: Replace @exception with @throws java.rmi.registry package 8252541: Replace @exception with @throws java.rmi.server package Reviewed-by: rriggs, sspitsyn, lancea --- .../share/classes/java/sql/Connection.java | 154 ++++++++++----------- 1 file changed, 77 insertions(+), 77 deletions(-) (limited to 'src/java.sql/share/classes/java/sql/Connection.java') diff --git a/src/java.sql/share/classes/java/sql/Connection.java b/src/java.sql/share/classes/java/sql/Connection.java index f3a6da0caa5..1b9df392e11 100644 --- a/src/java.sql/share/classes/java/sql/Connection.java +++ b/src/java.sql/share/classes/java/sql/Connection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -99,7 +99,7 @@ public interface Connection extends Wrapper, AutoCloseable { * calling {@link #getHoldability}. * * @return a new default Statement object - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection */ Statement createStatement() throws SQLException; @@ -133,7 +133,7 @@ public interface Connection extends Wrapper, AutoCloseable { * parameter placeholders * @return a new default PreparedStatement object containing the * pre-compiled SQL statement - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection */ PreparedStatement prepareStatement(String sql) @@ -166,7 +166,7 @@ public interface Connection extends Wrapper, AutoCloseable { * call escape syntax. * @return a new default CallableStatement object containing the * pre-compiled SQL statement - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection */ CallableStatement prepareCall(String sql) throws SQLException; @@ -180,7 +180,7 @@ public interface Connection extends Wrapper, AutoCloseable { * @param sql an SQL statement that may contain one or more '?' * parameter placeholders * @return the native form of this statement - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection */ String nativeSQL(String sql) throws SQLException; @@ -215,7 +215,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @param autoCommit true to enable auto-commit mode; * false to disable it - * @exception SQLException if a database access error occurs, + * @throws SQLException if a database access error occurs, * setAutoCommit(true) is called while participating in a distributed transaction, * or this method is called on a closed connection * @see #getAutoCommit @@ -228,7 +228,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @return the current state of this Connection object's * auto-commit mode - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection * @see #setAutoCommit */ @@ -241,10 +241,10 @@ public interface Connection extends Wrapper, AutoCloseable { * This method should be * used only when auto-commit mode has been disabled. * - * @exception SQLException if a database access error occurs, + * @throws SQLException if a database access error occurs, * this method is called while participating in a distributed transaction, * if this method is called on a closed connection or this - * Connection object is in auto-commit mode + * {@code Connection} object is in auto-commit mode * @see #setAutoCommit */ void commit() throws SQLException; @@ -255,10 +255,10 @@ public interface Connection extends Wrapper, AutoCloseable { * by this Connection object. This method should be * used only when auto-commit mode has been disabled. * - * @exception SQLException if a database access error occurs, + * @throws SQLException if a database access error occurs, * this method is called while participating in a distributed transaction, * this method is called on a closed connection or this - * Connection object is in auto-commit mode + * {@code Connection} object is in auto-commit mode * @see #setAutoCommit */ void rollback() throws SQLException; @@ -275,7 +275,7 @@ public interface Connection extends Wrapper, AutoCloseable { * close method. If the close method is called * and there is an active transaction, the results are implementation-defined. * - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs */ void close() throws SQLException; @@ -294,7 +294,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @return true if this Connection object * is closed; false if it is still open - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs */ boolean isClosed() throws SQLException; @@ -311,7 +311,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @return a DatabaseMetaData object for this * Connection object - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection */ DatabaseMetaData getMetaData() throws SQLException; @@ -324,7 +324,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @param readOnly true enables read-only mode; * false disables it - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection or this * method is called during a transaction */ @@ -336,7 +336,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @return true if this Connection object * is read-only; false otherwise - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection */ boolean isReadOnly() throws SQLException; @@ -358,7 +358,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @param catalog the name of a catalog (subspace in this * Connection object's database) in which to work - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection * @see #getCatalog */ @@ -368,7 +368,7 @@ public interface Connection extends Wrapper, AutoCloseable { * Retrieves this Connection object's current catalog name. * * @return the current catalog name or null if there is none - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection * @see #setCatalog */ @@ -438,9 +438,9 @@ public interface Connection extends Wrapper, AutoCloseable { * Connection.TRANSACTION_SERIALIZABLE. * (Note that Connection.TRANSACTION_NONE cannot be used * because it specifies that transactions are not supported.) - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection - * or the given parameter is not one of the Connection + * or the given parameter is not one of the {@code Connection} * constants * @see DatabaseMetaData#supportsTransactionIsolationLevel * @see #getTransactionIsolation @@ -458,7 +458,7 @@ public interface Connection extends Wrapper, AutoCloseable { * Connection.TRANSACTION_REPEATABLE_READ, * Connection.TRANSACTION_SERIALIZABLE, or * Connection.TRANSACTION_NONE. - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection * @see #setTransactionIsolation */ @@ -481,8 +481,8 @@ public interface Connection extends Wrapper, AutoCloseable { * * @return the first SQLWarning object or null * if there are none - * @exception SQLException if a database access error occurs or - * this method is called on a closed connection + * @throws SQLException if a database access error occurs or + * this method is called on a closed connection * @see SQLWarning */ SQLWarning getWarnings() throws SQLException; @@ -493,7 +493,7 @@ public interface Connection extends Wrapper, AutoCloseable { * returns null until a new warning is * reported for this Connection object. * - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection */ void clearWarnings() throws SQLException; @@ -520,11 +520,11 @@ public interface Connection extends Wrapper, AutoCloseable { * @return a new Statement object that will generate * ResultSet objects with the given type and * concurrency - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection - * or the given parameters are not ResultSet + * or the given parameters are not {@code ResultSet} * constants indicating type and concurrency - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method or this method is not supported for the specified result * set type and result set concurrency. * @since 1.2 @@ -555,11 +555,11 @@ public interface Connection extends Wrapper, AutoCloseable { * @return a new PreparedStatement object containing the * pre-compiled SQL statement that will produce ResultSet * objects with the given type and concurrency - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection - * or the given parameters are not ResultSet + * or the given parameters are not {@code ResultSet} * constants indicating type and concurrency - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method or this method is not supported for the specified result * set type and result set concurrency. * @since 1.2 @@ -589,11 +589,11 @@ public interface Connection extends Wrapper, AutoCloseable { * @return a new CallableStatement object containing the * pre-compiled SQL statement that will produce ResultSet * objects with the given type and concurrency - * @exception SQLException if a database access error occurs, this method + * @throws SQLException if a database access error occurs, this method * is called on a closed connection - * or the given parameters are not ResultSet + * or the given parameters are not {@code ResultSet} * constants indicating type and concurrency - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method or this method is not supported for the specified result * set type and result set concurrency. * @since 1.2 @@ -619,9 +619,9 @@ public interface Connection extends Wrapper, AutoCloseable { * * @return the java.util.Map object associated * with this Connection object - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @since 1.2 * @see #setTypeMap @@ -645,11 +645,11 @@ public interface Connection extends Wrapper, AutoCloseable { * @param map the java.util.Map object to install * as the replacement for this Connection * object's default type map - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection or - * the given parameter is not a java.util.Map + * the given parameter is not a {@code java.util.Map} * object - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @since 1.2 * @see #getTypeMap @@ -672,7 +672,7 @@ public interface Connection extends Wrapper, AutoCloseable { * @throws SQLException if a database access occurs, this method is called * on a closed connection, or the given parameter * is not a ResultSet constant indicating holdability - * @exception SQLFeatureNotSupportedException if the given holdability is not supported + * @throws SQLFeatureNotSupportedException if the given holdability is not supported * @see #getHoldability * @see DatabaseMetaData#getResultSetHoldability * @see ResultSet @@ -704,12 +704,12 @@ public interface Connection extends Wrapper, AutoCloseable { *savepoint. * * @return the new Savepoint object - * @exception SQLException if a database access error occurs, + * @throws SQLException if a database access error occurs, * this method is called while participating in a distributed transaction, * this method is called on a closed connection - * or this Connection object is currently in + * or this {@code Connection} object is currently in * auto-commit mode - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @see Savepoint * @since 1.4 @@ -725,12 +725,12 @@ public interface Connection extends Wrapper, AutoCloseable { * * @param name a String containing the name of the savepoint * @return the new Savepoint object - * @exception SQLException if a database access error occurs, + * @throws SQLException if a database access error occurs, * this method is called while participating in a distributed transaction, * this method is called on a closed connection - * or this Connection object is currently in + * or this {@code Connection} object is currently in * auto-commit mode - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @see Savepoint * @since 1.4 @@ -744,13 +744,13 @@ public interface Connection extends Wrapper, AutoCloseable { * This method should be used only when auto-commit has been disabled. * * @param savepoint the Savepoint object to roll back to - * @exception SQLException if a database access error occurs, + * @throws SQLException if a database access error occurs, * this method is called while participating in a distributed transaction, * this method is called on a closed connection, - * the Savepoint object is no longer valid, - * or this Connection object is currently in + * the {@code Savepoint} object is no longer valid, + * or this {@code Connection} object is currently in * auto-commit mode - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @see Savepoint * @see #rollback @@ -764,11 +764,11 @@ public interface Connection extends Wrapper, AutoCloseable { * will cause an SQLException to be thrown. * * @param savepoint the Savepoint object to be removed - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection or - * the given Savepoint object is not a valid + * the given {@code Savepoint} object is not a valid * savepoint in the current transaction - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @since 1.4 */ @@ -798,11 +798,11 @@ public interface Connection extends Wrapper, AutoCloseable { * @return a new Statement object that will generate * ResultSet objects with the given type, * concurrency, and holdability - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection - * or the given parameters are not ResultSet + * or the given parameters are not {@code ResultSet} * constants indicating type, concurrency, and holdability - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method or this method is not supported for the specified result * set type, result set holdability and result set concurrency. * @see ResultSet @@ -840,11 +840,11 @@ public interface Connection extends Wrapper, AutoCloseable { * pre-compiled SQL statement, that will generate * ResultSet objects with the given type, * concurrency, and holdability - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection - * or the given parameters are not ResultSet + * or the given parameters are not {@code ResultSet} * constants indicating type, concurrency, and holdability - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method or this method is not supported for the specified result * set type, result set holdability and result set concurrency. * @see ResultSet @@ -880,11 +880,11 @@ public interface Connection extends Wrapper, AutoCloseable { * pre-compiled SQL statement, that will generate * ResultSet objects with the given type, * concurrency, and holdability - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection - * or the given parameters are not ResultSet + * or the given parameters are not {@code ResultSet} * constants indicating type, concurrency, and holdability - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method or this method is not supported for the specified result * set type, result set holdability and result set concurrency. * @see ResultSet @@ -928,12 +928,12 @@ public interface Connection extends Wrapper, AutoCloseable { * @return a new PreparedStatement object, containing the * pre-compiled SQL statement, that will have the capability of * returning auto-generated keys - * @exception SQLException if a database access error occurs, this + * @throws SQLException if a database access error occurs, this * method is called on a closed connection - * or the given parameter is not a Statement + * or the given parameter is not a {@code Statement} * constant indicating whether auto-generated keys should be * returned - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method with a constant of Statement.RETURN_GENERATED_KEYS * @since 1.4 */ @@ -978,9 +978,9 @@ public interface Connection extends Wrapper, AutoCloseable { * pre-compiled statement, that is capable of returning the * auto-generated keys designated by the given array of column * indexes - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * * @since 1.4 @@ -1026,9 +1026,9 @@ public interface Connection extends Wrapper, AutoCloseable { * pre-compiled statement, that is capable of returning the * auto-generated keys designated by the given array of column * names - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * * @since 1.4 @@ -1045,7 +1045,7 @@ public interface Connection extends Wrapper, AutoCloseable { * @throws SQLException if an object that implements the * Clob interface can not be constructed, this method is * called on a closed connection or a database access error occurs. - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this data type * * @since 1.6 @@ -1061,7 +1061,7 @@ public interface Connection extends Wrapper, AutoCloseable { * @throws SQLException if an object that implements the * Blob interface can not be constructed, this method is * called on a closed connection or a database access error occurs. - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this data type * * @since 1.6 @@ -1077,7 +1077,7 @@ public interface Connection extends Wrapper, AutoCloseable { * @throws SQLException if an object that implements the * NClob interface can not be constructed, this method is * called on a closed connection or a database access error occurs. - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this data type * * @since 1.6 @@ -1093,7 +1093,7 @@ public interface Connection extends Wrapper, AutoCloseable { * @throws SQLException if an object that implements the SQLXML interface can not * be constructed, this method is * called on a closed connection or a database access error occurs. - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this data type * @since 1.6 */ @@ -1116,7 +1116,7 @@ public interface Connection extends Wrapper, AutoCloseable { * database operation. * * @return true if the connection is valid, false otherwise - * @exception SQLException if the value supplied for timeout + * @throws SQLException if the value supplied for {@code timeout} * is less than 0 * @since 1.6 * @@ -1318,7 +1318,7 @@ throws SQLException; * {@code Statement} is created or prepared. * * @param schema the name of a schema in which to work - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection * @see #getSchema * @since 1.7 @@ -1329,7 +1329,7 @@ throws SQLException; * Retrieves this Connection object's current schema name. * * @return the current schema name or null if there is none - * @exception SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or this method is called on a closed connection * @see #setSchema * @since 1.7 @@ -1455,7 +1455,7 @@ throws SQLException; * @throws java.lang.SecurityException if a security manager exists and its * checkPermission method denies calling * setNetworkTimeout. - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @see SecurityManager#checkPermission * @see Statement#setQueryTimeout @@ -1477,7 +1477,7 @@ throws SQLException; * no limit * @throws SQLException if a database access error occurs or * this method is called on a closed Connection - * @exception SQLFeatureNotSupportedException if the JDBC driver does not support + * @throws SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @see #setNetworkTimeout * @since 1.7 -- cgit v1.3.1