jdk/src/java.sql/share/classes/java/sql/Connection.java
author duke
Wed, 05 Jul 2017 19:59:42 +0200
changeset 26369 4554006fae4a
parent 25991 e48157b42439
child 27778 f3e0156f99d7
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 21278
diff changeset
     2
 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.Properties;
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    29
import java.util.concurrent.Executor;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * <P>A connection (session) with a specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * database. SQL statements are executed and results are returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * within the context of a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * A <code>Connection</code> object's database is able to provide information
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * describing its tables, its supported SQL grammar, its stored
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * procedures, the capabilities of this connection, and so on. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * information is obtained with the <code>getMetaData</code> method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <P><B>Note:</B> When configuring a <code>Connection</code>, JDBC applications
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    42
 *  should use the appropriate <code>Connection</code> method such as
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *  <code>setAutoCommit</code> or <code>setTransactionIsolation</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *  Applications should not invoke SQL commands directly to change the connection's
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *   configuration when there is a JDBC method available.  By default a <code>Connection</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * auto-commit mode, which means that it automatically commits changes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * after executing each statement. If auto-commit mode has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * disabled, the method <code>commit</code> must be called explicitly in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * order to commit changes; otherwise, database changes will not be saved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * A new <code>Connection</code> object created using the JDBC 2.1 core API
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * has an initially empty type map associated with it. A user may enter a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * custom mapping for a UDT in this type map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * When a UDT is retrieved from a data source with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * method <code>ResultSet.getObject</code>, the <code>getObject</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * will check the connection's type map to see if there is an entry for that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * UDT.  If so, the <code>getObject</code> method will map the UDT to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * class indicated.  If there is no entry, the UDT will be mapped using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * standard mapping.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * A user may create a new type map, which is a <code>java.util.Map</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * object, make an entry in it, and pass it to the <code>java.sql</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * methods that can perform custom mapping.  In this case, the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * will use the given type map instead of the one associated with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * the connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * For example, the following code fragment specifies that the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * type <code>ATHLETES</code> will be mapped to the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * <code>Athletes</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * The code fragment retrieves the type map for the <code>Connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * </code> object <code>con</code>, inserts the entry into it, and then sets
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * the type map with the new entry as the connection's type map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *      java.util.Map map = con.getTypeMap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 *      map.put("mySchemaName.ATHLETES", Class.forName("Athletes"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 *      con.setTypeMap(map);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * @see DriverManager#getConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * @see Statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * @see DatabaseMetaData
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 */
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    84
public interface Connection  extends Wrapper, AutoCloseable {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * Creates a <code>Statement</code> object for sending
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * SQL statements to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * SQL statements without parameters are normally
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * executed using <code>Statement</code> objects. If the same SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * is executed many times, it may be more efficient to use a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * <code>PreparedStatement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * Result sets created using the returned <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @return a new default <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    Statement createStatement() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * Creates a <code>PreparedStatement</code> object for sending
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * parameterized SQL statements to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * A SQL statement with or without IN parameters can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * pre-compiled and stored in a <code>PreparedStatement</code> object. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * object can then be used to efficiently execute this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * multiple times.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * <P><B>Note:</B> This method is optimized for handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * parametric SQL statements that benefit from precompilation. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * the driver supports precompilation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * the method <code>prepareStatement</code> will send
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * the statement to the database for precompilation. Some drivers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * may not support precompilation. In this case, the statement may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * not be sent to the database until the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * object is executed.  This has no direct effect on users; however, it does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * affect which methods throw certain <code>SQLException</code> objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * Result sets created using the returned <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @param sql an SQL statement that may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @return a new default <code>PreparedStatement</code> object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * pre-compiled SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    PreparedStatement prepareStatement(String sql)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * Creates a <code>CallableStatement</code> object for calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * database stored procedures.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * The <code>CallableStatement</code> object provides
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * methods for setting up its IN and OUT parameters, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * methods for executing the call to a stored procedure.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * <P><B>Note:</B> This method is optimized for handling stored
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * procedure call statements. Some drivers may send the call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * statement to the database when the method <code>prepareCall</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * is done; others
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * may wait until the <code>CallableStatement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * is executed. This has no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * direct effect on users; however, it does affect which method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * throws certain SQLExceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * Result sets created using the returned <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @param sql an SQL statement that may contain one or more '?'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * parameter placeholders. Typically this statement is specified using JDBC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * call escape syntax.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @return a new default <code>CallableStatement</code> object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * pre-compiled SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    CallableStatement prepareCall(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * Converts the given SQL statement into the system's native SQL grammar.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * A driver may convert the JDBC SQL grammar into its system's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * native SQL grammar prior to sending it. This method returns the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * native form of the statement that the driver would have sent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * @param sql an SQL statement that may contain one or more '?'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * @return the native form of this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    String nativeSQL(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * Sets this connection's auto-commit mode to the given state.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * If a connection is in auto-commit mode, then all its SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * statements will be executed and committed as individual
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * transactions.  Otherwise, its SQL statements are grouped into
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * transactions that are terminated by a call to either
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * the method <code>commit</code> or the method <code>rollback</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * By default, new connections are in auto-commit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * The commit occurs when the statement completes. The time when the statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * completes depends on the type of SQL Statement:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * <li>For DML statements, such as Insert, Update or Delete, and DDL statements,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * the statement is complete as soon as it has finished executing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * <li>For Select statements, the statement is complete when the associated result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * set is closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * <li>For <code>CallableStatement</code> objects or for statements that return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * multiple results, the statement is complete
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * when all of the associated result sets have been closed, and all update
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * counts and output parameters have been retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     *</ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * <B>NOTE:</B>  If this method is called during a transaction and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * auto-commit mode is changed, the transaction is committed.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * <code>setAutoCommit</code> is called and the auto-commit mode is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * not changed, the call is a no-op.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * @param autoCommit <code>true</code> to enable auto-commit mode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     *         <code>false</code> to disable it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     *  setAutoCommit(true) is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @see #getAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    void setAutoCommit(boolean autoCommit) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * Retrieves the current auto-commit mode for this <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * @return the current state of this <code>Connection</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     *         auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @see #setAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    boolean getAutoCommit() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * Makes all changes made since the previous
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * commit/rollback permanent and releases any database locks
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * currently held by this <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * This method should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * used only when auto-commit mode has been disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * this method is called while participating in a distributed transaction,
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20880
diff changeset
   245
     * if this method is called on a closed connection or this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     *            <code>Connection</code> object is in auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @see #setAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    void commit() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * Undoes all changes made in the current transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * and releases any database locks currently held
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * by this <code>Connection</code> object. This method should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * used only when auto-commit mode has been disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * this method is called on a closed connection or this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     *            <code>Connection</code> object is in auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * @see #setAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    void rollback() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * Releases this <code>Connection</code> object's database and JDBC resources
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * immediately instead of waiting for them to be automatically released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * Calling the method <code>close</code> on a <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * object that is already closed is a no-op.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * It is <b>strongly recommended</b> that an application explicitly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * commits or rolls back an active transaction prior to calling the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * <code>close</code> method.  If the <code>close</code> method is called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * and there is an active transaction, the results are implementation-defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     *
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   277
     * @exception SQLException if a database access error occurs
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    void close() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * Retrieves whether this <code>Connection</code> object has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * closed.  A connection is closed if the method <code>close</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * has been called on it or if certain fatal errors have occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * This method is guaranteed to return <code>true</code> only when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * it is called after the method <code>Connection.close</code> has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * been called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * This method generally cannot be called to determine whether a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * connection to a database is valid or invalid.  A typical client
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * can determine that a connection is invalid by catching any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * exceptions that might be thrown when an operation is attempted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * @return <code>true</code> if this <code>Connection</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     *         is closed; <code>false</code> if it is still open
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    boolean isClosed() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    //======================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
    // Advanced features:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * Retrieves a <code>DatabaseMetaData</code> object that contains
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * metadata about the database to which this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * <code>Connection</code> object represents a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * The metadata includes information about the database's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * tables, its supported SQL grammar, its stored
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * procedures, the capabilities of this connection, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * @return a <code>DatabaseMetaData</code> object for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     *         <code>Connection</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * @exception  SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    DatabaseMetaData getMetaData() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * Puts this connection in read-only mode as a hint to the driver to enable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * database optimizations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * <P><B>Note:</B> This method cannot be called during a transaction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * @param readOnly <code>true</code> enables read-only mode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     *        <code>false</code> disables it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     *  method is called on a closed connection or this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     *            method is called during a transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    void setReadOnly(boolean readOnly) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * Retrieves whether this <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * object is in read-only mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * @return <code>true</code> if this <code>Connection</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     *         is read-only; <code>false</code> otherwise
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   338
     * @exception SQLException if a database access error occurs
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    boolean isReadOnly() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * Sets the given catalog name in order to select
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * a subspace of this <code>Connection</code> object's database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * in which to work.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * If the driver does not support catalogs, it will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * silently ignore this request.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   350
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   351
     * Calling {@code setCatalog} has no effect on previously created or prepared
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   352
     * {@code Statement} objects. It is implementation defined whether a DBMS
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   353
     * prepare operation takes place immediately when the {@code Connection}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   354
     * method {@code prepareStatement} or {@code prepareCall} is invoked.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   355
     * For maximum portability, {@code setCatalog} should be called before a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   356
     * {@code Statement} is created or prepared.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @param catalog the name of a catalog (subspace in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     *        <code>Connection</code> object's database) in which to work
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * @see #getCatalog
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    void setCatalog(String catalog) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * Retrieves this <code>Connection</code> object's current catalog name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * @return the current catalog name or <code>null</code> if there is none
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * @see #setCatalog
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    String getCatalog() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * A constant indicating that transactions are not supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    int TRANSACTION_NONE             = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * A constant indicating that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * dirty reads, non-repeatable reads and phantom reads can occur.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * This level allows a row changed by one transaction to be read
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * by another transaction before any changes in that row have been
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * committed (a "dirty read").  If any of the changes are rolled back,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * the second transaction will have retrieved an invalid row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    int TRANSACTION_READ_UNCOMMITTED = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * A constant indicating that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * dirty reads are prevented; non-repeatable reads and phantom
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * reads can occur.  This level only prohibits a transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * from reading a row with uncommitted changes in it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
    int TRANSACTION_READ_COMMITTED   = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * A constant indicating that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * dirty reads and non-repeatable reads are prevented; phantom
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * reads can occur.  This level prohibits a transaction from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * reading a row with uncommitted changes in it, and it also
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * prohibits the situation where one transaction reads a row,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * a second transaction alters the row, and the first transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * rereads the row, getting different values the second time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * (a "non-repeatable read").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    int TRANSACTION_REPEATABLE_READ  = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * A constant indicating that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * dirty reads, non-repeatable reads and phantom reads are prevented.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * This level includes the prohibitions in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * <code>TRANSACTION_REPEATABLE_READ</code> and further prohibits the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * situation where one transaction reads all rows that satisfy
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * a <code>WHERE</code> condition, a second transaction inserts a row that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * satisfies that <code>WHERE</code> condition, and the first transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * rereads for the same condition, retrieving the additional
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * "phantom" row in the second read.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    int TRANSACTION_SERIALIZABLE     = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * Attempts to change the transaction isolation level for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * <code>Connection</code> object to the one given.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * The constants defined in the interface <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * are the possible transaction isolation levels.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * <B>Note:</B> If this method is called during a transaction, the result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * is implementation-defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @param level one of the following <code>Connection</code> constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     *        <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     *        <code>Connection.TRANSACTION_READ_COMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     *        <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     *        <code>Connection.TRANSACTION_SERIALIZABLE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     *        (Note that <code>Connection.TRANSACTION_NONE</code> cannot be used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     *        because it specifies that transactions are not supported.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     *            or the given parameter is not one of the <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     *            constants
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @see DatabaseMetaData#supportsTransactionIsolationLevel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * @see #getTransactionIsolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
    void setTransactionIsolation(int level) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * Retrieves this <code>Connection</code> object's current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * transaction isolation level.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * @return the current transaction isolation level, which will be one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     *         of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     *        <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     *        <code>Connection.TRANSACTION_READ_COMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     *        <code>Connection.TRANSACTION_REPEATABLE_READ</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     *        <code>Connection.TRANSACTION_SERIALIZABLE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     *        <code>Connection.TRANSACTION_NONE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * @see #setTransactionIsolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
    int getTransactionIsolation() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * Retrieves the first warning reported by calls on this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * <code>Connection</code> object.  If there is more than one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * warning, subsequent warnings will be chained to the first one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * and can be retrieved by calling the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * <code>SQLWarning.getNextWarning</code> on the warning
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * that was retrieved previously.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * This method may not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * called on a closed connection; doing so will cause an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * <code>SQLException</code> to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * <P><B>Note:</B> Subsequent warnings will be chained to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * SQLWarning.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * @return the first <code>SQLWarning</code> object or <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     *         if there are none
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     *            this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * @see SQLWarning
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
    SQLWarning getWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * Clears all warnings reported for this <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * After a call to this method, the method <code>getWarnings</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * returns <code>null</code> until a new warning is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * reported for this <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     *
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   495
     * @exception SQLException if a database access error occurs
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
    void clearWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
    //--------------------------JDBC 2.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * Creates a <code>Statement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * <code>ResultSet</code> objects with the given type and concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * This method is the same as the <code>createStatement</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * type and concurrency to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * @param resultSetType a result set type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     *        <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     *        <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     *        <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * @param resultSetConcurrency a concurrency type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     *        <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     *        <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * @return a new <code>Statement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     *         <code>ResultSet</code> objects with the given type and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     *         concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     *         or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     *         constants indicating type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * set type and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
    Statement createStatement(int resultSetType, int resultSetConcurrency)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * Creates a <code>PreparedStatement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * <code>ResultSet</code> objects with the given type and concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * This method is the same as the <code>prepareStatement</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * type and concurrency to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * @param sql a <code>String</code> object that is the SQL statement to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     *            be sent to the database; may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     *            parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * @param resultSetType a result set type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * @param resultSetConcurrency a concurrency type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * @return a new PreparedStatement object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * pre-compiled SQL statement that will produce <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * objects with the given type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     *         or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     *         constants indicating type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * set type and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
    PreparedStatement prepareStatement(String sql, int resultSetType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
                                       int resultSetConcurrency)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * Creates a <code>CallableStatement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * <code>ResultSet</code> objects with the given type and concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * This method is the same as the <code>prepareCall</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * type and concurrency to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * @param sql a <code>String</code> object that is the SQL statement to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     *            be sent to the database; may contain on or more '?' parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * @param resultSetType a result set type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * @param resultSetConcurrency a concurrency type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * @return a new <code>CallableStatement</code> object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * pre-compiled SQL statement that will produce <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * objects with the given type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * @exception SQLException if a database access error occurs, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     *         or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     *         constants indicating type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * set type and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
    CallableStatement prepareCall(String sql, int resultSetType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
                                  int resultSetConcurrency) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * Retrieves the <code>Map</code> object associated with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * Unless the application has added an entry, the type map returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     * will be empty.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   608
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   609
     * You must invoke <code>setTypeMap</code> after making changes to the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   610
     * <code>Map</code> object returned from
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   611
     *  <code>getTypeMap</code> as a JDBC driver may create an internal
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   612
     * copy of the <code>Map</code> object passed to <code>setTypeMap</code>:
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 6540
diff changeset
   613
     *
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   614
     * <pre>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   615
     *      Map&lt;String,Class&lt;?&gt;&gt; myMap = con.getTypeMap();
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   616
     *      myMap.put("mySchemaName.ATHLETES", Athletes.class);
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   617
     *      con.setTypeMap(myMap);
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   618
     * </pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * @return the <code>java.util.Map</code> object associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     *         with this <code>Connection</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     * @see #setTypeMap
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
    java.util.Map<String,Class<?>> getTypeMap() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * Installs the given <code>TypeMap</code> object as the type map for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     * this <code>Connection</code> object.  The type map will be used for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
     * custom mapping of SQL structured types and distinct types.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
   634
     * <p>
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   635
     * You must set the values for the <code>TypeMap</code> prior to
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   636
     * callng <code>setMap</code> as a JDBC driver may create an internal copy
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   637
     * of the <code>TypeMap</code>:
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 6540
diff changeset
   638
     *
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   639
     * <pre>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   640
     *      Map myMap&lt;String,Class&lt;?&gt;&gt; = new HashMap&lt;String,Class&lt;?&gt;&gt;();
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   641
     *      myMap.put("mySchemaName.ATHLETES", Athletes.class);
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   642
     *      con.setTypeMap(myMap);
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   643
     * </pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     * @param map the <code>java.util.Map</code> object to install
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     *        as the replacement for this <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     *        object's default type map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * method is called on a closed connection or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     *        the given parameter is not a <code>java.util.Map</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     *        object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * @see #getTypeMap
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
    void setTypeMap(java.util.Map<String,Class<?>> map) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
    //--------------------------JDBC 3.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * Changes the default holdability of <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * created using this <code>Connection</code> object to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * holdability.  The default holdability of <code>ResultSet</code> objects
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   665
     * can be determined by invoking
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * {@link DatabaseMetaData#getResultSetHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     * @param holdability a <code>ResultSet</code> holdability constant; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     *        <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     *        <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
     * @throws SQLException if a database access occurs, this method is called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
     * on a closed connection, or the given parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     *         is not a <code>ResultSet</code> constant indicating holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     * @exception SQLFeatureNotSupportedException if the given holdability is not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     * @see #getHoldability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     * @see DatabaseMetaData#getResultSetHoldability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
    void setHoldability(int holdability) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     * Retrieves the current holdability of <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * created using this <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * @return the holdability, one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     *        <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     *        <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * @throws SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * @see #setHoldability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     * @see DatabaseMetaData#getResultSetHoldability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
    int getHoldability() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * Creates an unnamed savepoint in the current transaction and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * returns the new <code>Savepoint</code> object that represents it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     *<p> if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly created
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     *savepoint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * @return the new <code>Savepoint</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     *            or this <code>Connection</code> object is currently in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     *            auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * @see Savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
    Savepoint setSavepoint() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * Creates a savepoint with the given name in the current transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     * and returns the new <code>Savepoint</code> object that represents it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * <p> if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly created
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     *savepoint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * @param name a <code>String</code> containing the name of the savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     * @return the new <code>Savepoint</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
          * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     *            or this <code>Connection</code> object is currently in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     *            auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     * @see Savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
    Savepoint setSavepoint(String name) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
     * Undoes all changes made after the given <code>Savepoint</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     * was set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     * This method should be used only when auto-commit has been disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
     * @param savepoint the <code>Savepoint</code> object to roll back to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     * this method is called on a closed connection,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     *            the <code>Savepoint</code> object is no longer valid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     *            or this <code>Connection</code> object is currently in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     *            auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     * @see Savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * @see #rollback
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
    void rollback(Savepoint savepoint) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * Removes the specified <code>Savepoint</code>  and subsequent <code>Savepoint</code> objects from the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     * transaction. Any reference to the savepoint after it have been removed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * will cause an <code>SQLException</code> to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     * @param savepoint the <code>Savepoint</code> object to be removed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     *  method is called on a closed connection or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     *            the given <code>Savepoint</code> object is not a valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     *            savepoint in the current transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
    void releaseSavepoint(Savepoint savepoint) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * Creates a <code>Statement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * <code>ResultSet</code> objects with the given type, concurrency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     * and holdability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     * This method is the same as the <code>createStatement</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * type, concurrency, and holdability to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
     * @param resultSetType one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * @param resultSetConcurrency one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * @param resultSetHoldability one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     *         <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * @return a new <code>Statement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     *         <code>ResultSet</code> objects with the given type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     *         concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     *            or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     *            constants indicating type, concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     * set type, result set holdability and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
    Statement createStatement(int resultSetType, int resultSetConcurrency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
                              int resultSetHoldability) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     * Creates a <code>PreparedStatement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * <code>ResultSet</code> objects with the given type, concurrency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * and holdability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     * This method is the same as the <code>prepareStatement</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
     * type, concurrency, and holdability to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * @param sql a <code>String</code> object that is the SQL statement to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     *            be sent to the database; may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     *            parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * @param resultSetType one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     * @param resultSetConcurrency one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * @param resultSetHoldability one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     *         <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     * @return a new <code>PreparedStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     *         pre-compiled SQL statement, that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     *         <code>ResultSet</code> objects with the given type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     *         concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     *            or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     *            constants indicating type, concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * set type, result set holdability and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
    PreparedStatement prepareStatement(String sql, int resultSetType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
                                       int resultSetConcurrency, int resultSetHoldability)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     * Creates a <code>CallableStatement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     * <code>ResultSet</code> objects with the given type and concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     * This method is the same as the <code>prepareCall</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     * type, result set concurrency type and holdability to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * @param sql a <code>String</code> object that is the SQL statement to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     *            be sent to the database; may contain on or more '?' parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     * @param resultSetType one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     * @param resultSetConcurrency one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * @param resultSetHoldability one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     *         <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     * @return a new <code>CallableStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     *         pre-compiled SQL statement, that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     *         <code>ResultSet</code> objects with the given type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     *         concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     *            or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     *            constants indicating type, concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * set type, result set holdability and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
    CallableStatement prepareCall(String sql, int resultSetType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
                                  int resultSetConcurrency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
                                  int resultSetHoldability) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     * Creates a default <code>PreparedStatement</code> object that has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
     * the capability to retrieve auto-generated keys. The given constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     * tells the driver whether it should make auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
     * available for retrieval.  This parameter is ignored if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     * <B>Note:</B> This method is optimized for handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     * parametric SQL statements that benefit from precompilation. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
     * the driver supports precompilation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
     * the method <code>prepareStatement</code> will send
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
     * the statement to the database for precompilation. Some drivers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
     * may not support precompilation. In this case, the statement may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     * not be sent to the database until the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
     * object is executed.  This has no direct effect on users; however, it does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
     * affect which methods throw certain SQLExceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
     * Result sets created using the returned <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     * @param sql an SQL statement that may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     *        parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * @param autoGeneratedKeys a flag indicating whether auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     *        should be returned; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     *        <code>Statement.RETURN_GENERATED_KEYS</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     *        <code>Statement.NO_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * @return a new <code>PreparedStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     *         pre-compiled SQL statement, that will have the capability of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     *         returning auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     *  method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
     *         or the given parameter is not a <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
     *         constant indicating whether auto-generated keys should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
     *         returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
    PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     * Creates a default <code>PreparedStatement</code> object capable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     * of returning the auto-generated keys designated by the given array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     * This array contains the indexes of the columns in the target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     * table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
     * available.  The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * An SQL statement with or without IN parameters can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     * pre-compiled and stored in a <code>PreparedStatement</code> object. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     * object can then be used to efficiently execute this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     * multiple times.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
     * <B>Note:</B> This method is optimized for handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     * parametric SQL statements that benefit from precompilation. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     * the driver supports precompilation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
     * the method <code>prepareStatement</code> will send
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     * the statement to the database for precompilation. Some drivers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
     * may not support precompilation. In this case, the statement may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
     * not be sent to the database until the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
     * object is executed.  This has no direct effect on users; however, it does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
     * affect which methods throw certain SQLExceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
     * Result sets created using the returned <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     * @param sql an SQL statement that may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     *        parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     * @param columnIndexes an array of column indexes indicating the columns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     *        that should be returned from the inserted row or rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
     * @return a new <code>PreparedStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     *         pre-compiled statement, that is capable of returning the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     *         auto-generated keys designated by the given array of column
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     *         indexes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
    PreparedStatement prepareStatement(String sql, int columnIndexes[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * Creates a default <code>PreparedStatement</code> object capable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     * of returning the auto-generated keys designated by the given array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
     * This array contains the names of the columns in the target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
     * table that contain the auto-generated keys that should be returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
     * The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
     * An SQL statement with or without IN parameters can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
     * pre-compiled and stored in a <code>PreparedStatement</code> object. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
     * object can then be used to efficiently execute this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
     * multiple times.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
     * <B>Note:</B> This method is optimized for handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
     * parametric SQL statements that benefit from precompilation. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
     * the driver supports precompilation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
     * the method <code>prepareStatement</code> will send
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
     * the statement to the database for precompilation. Some drivers
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
     * may not support precompilation. In this case, the statement may
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
     * not be sent to the database until the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
     * object is executed.  This has no direct effect on users; however, it does
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
     * affect which methods throw certain SQLExceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     * Result sets created using the returned <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
     * @param sql an SQL statement that may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
     *        parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     * @param columnNames an array of column names indicating the columns
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
     *        that should be returned from the inserted row or rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
     * @return a new <code>PreparedStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
     *         pre-compiled statement, that is capable of returning the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
     *         auto-generated keys designated by the given array of column
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
     *         names
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
    PreparedStatement prepareStatement(String sql, String columnNames[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
     * Constructs an object that implements the <code>Clob</code> interface. The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
     * returned initially contains no data.  The <code>setAsciiStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
     * <code>setCharacterStream</code> and <code>setString</code> methods of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
     * the <code>Clob</code> interface may be used to add data to the <code>Clob</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
     * @return An object that implements the <code>Clob</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
     * @throws SQLException if an object that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
     * <code>Clob</code> interface can not be constructed, this method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
     * called on a closed connection or a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
    Clob createClob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
     * Constructs an object that implements the <code>Blob</code> interface. The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
     * returned initially contains no data.  The <code>setBinaryStream</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
     * <code>setBytes</code> methods of the <code>Blob</code> interface may be used to add data to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
     * the <code>Blob</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
     * @return  An object that implements the <code>Blob</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
     * @throws SQLException if an object that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
     * <code>Blob</code> interface can not be constructed, this method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
     * called on a closed connection or a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
    Blob createBlob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
     * Constructs an object that implements the <code>NClob</code> interface. The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
     * returned initially contains no data.  The <code>setAsciiStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
     * <code>setCharacterStream</code> and <code>setString</code> methods of the <code>NClob</code> interface may
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
     * be used to add data to the <code>NClob</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
     * @return An object that implements the <code>NClob</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
     * @throws SQLException if an object that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
     * <code>NClob</code> interface can not be constructed, this method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
     * called on a closed connection or a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
    NClob createNClob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
     * Constructs an object that implements the <code>SQLXML</code> interface. The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
     * returned initially contains no data. The <code>createXmlStreamWriter</code> object and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
     * <code>setString</code> method of the <code>SQLXML</code> interface may be used to add data to the <code>SQLXML</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
     * @return An object that implements the <code>SQLXML</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
     * @throws SQLException if an object that implements the <code>SQLXML</code> interface can not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
     * be constructed, this method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
     * called on a closed connection or a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
    SQLXML createSQLXML() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
         * Returns true if the connection has not been closed and is still valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
         * The driver shall submit a query on the connection or use some other
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
         * mechanism that positively verifies the connection is still valid when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
         * this method is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
         * The query submitted by the driver to validate the connection shall be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
         * executed in the context of the current transaction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
         * @param timeout -             The time in seconds to wait for the database operation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
         *                                              used to validate the connection to complete.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
         *                                              the timeout period expires before the operation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
         *                                              completes, this method returns false.  A value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
         *                                              0 indicates a timeout is not applied to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
         *                                              database operation.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1116
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
         * @return true if the connection is valid, false otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
         * @exception SQLException if the value supplied for <code>timeout</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
         * is less then 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
         * @since 1.6
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 6540
diff changeset
  1121
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
         * @see java.sql.DatabaseMetaData#getClientInfoProperties
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
         boolean isValid(int timeout) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
         * Sets the value of the client info property specified by name to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
         * value specified by value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
         * Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
         * method to determine the client info properties supported by the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
         * and the maximum length that may be specified for each property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
         * The driver stores the value specified in a suitable location in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
         * database.  For example in a special register, session parameter, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
         * system table column.  For efficiency the driver may defer setting the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
         * value in the database until the next time a statement is executed or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
         * prepared.  Other than storing the client information in the appropriate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
         * place in the database, these methods shall not alter the behavior of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
         * the connection in anyway.  The values supplied to these methods are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
         * used for accounting, diagnostics and debugging purposes only.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
         * The driver shall generate a warning if the client info name specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
         * is not recognized by the driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
         * If the value specified to this method is greater than the maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
         * length for the property the driver may either truncate the value and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
         * generate a warning or generate a <code>SQLClientInfoException</code>.  If the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
         * generates a <code>SQLClientInfoException</code>, the value specified was not set on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
         * connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
         * The following are standard client info properties.  Drivers are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
         * required to support these properties however if the driver supports a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
         * client info property that can be described by one of the standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
         * properties, the standard property name should be used.
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 6540
diff changeset
  1156
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
         * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
         * <li>ApplicationName  -       The name of the application currently utilizing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
         *                                                      the connection</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
         * <li>ClientUser               -       The name of the user that the application using
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
         *                                                      the connection is performing work for.  This may
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
         *                                                      not be the same as the user name that was used
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
         *                                                      in establishing the connection.</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
         * <li>ClientHostname   -       The hostname of the computer the application
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
         *                                                      using the connection is running on.</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
         * </ul>
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1167
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
         * @param name          The name of the client info property to set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
         * @param value         The value to set the client info property to.  If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
         *                                      value is null, the current value of the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
         *                                      property is cleared.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1172
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
         * @throws      SQLClientInfoException if the database server returns an error while
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
         *                      setting the client info value on the database server or this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
         * is called on a closed connection
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1176
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
         void setClientInfo(String name, String value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
                throws SQLClientInfoException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
     * Sets the value of the connection's client info properties.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
     * <code>Properties</code> object contains the names and values of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
     * properties to be set.  The set of client info properties contained in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
     * the properties list replaces the current set of client info properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
     * on the connection.  If a property that is currently set on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
     * connection is not present in the properties list, that property is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
     * cleared.  Specifying an empty properties list will clear all of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
     * properties on the connection.  See <code>setClientInfo (String, String)</code> for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
     * more information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
     * If an error occurs in setting any of the client info properties, a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
     * <code>SQLClientInfoException</code> is thrown. The <code>SQLClientInfoException</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
     * contains information indicating which client info properties were not set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
     * The state of the client information is unknown because
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
     * some databases do not allow multiple client info properties to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
     * atomically.  For those databases, one or more properties may have been
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
     * set before the error occurred.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1200
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
     * @param properties                the list of client info properties to set
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1203
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
     * @see java.sql.Connection#setClientInfo(String, String) setClientInfo(String, String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
     * @since 1.6
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1206
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
     * @throws SQLClientInfoException if the database server returns an error while
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
     *                  setting the clientInfo values on the database server or this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
     * is called on a closed connection
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 6540
diff changeset
  1210
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
         void setClientInfo(Properties properties)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
                throws SQLClientInfoException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
         * Returns the value of the client info property specified by name.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
         * method may return null if the specified client info property has not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
         * been set and does not have a default value.  This method will also
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
         * return null if the specified client info property name is not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
         * by the driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
         * Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
         * method to determine the client info properties supported by the driver.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1224
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
         * @param name          The name of the client info property to retrieve
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1226
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
         * @return                      The value of the client info property specified
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1228
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
         * @throws SQLException         if the database server returns an error when
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1230
         *                              fetching the client info value from the database
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1231
         *                              or this method is called on a closed connection
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1232
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
         * @since 1.6
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 6540
diff changeset
  1234
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
         * @see java.sql.DatabaseMetaData#getClientInfoProperties
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
         String getClientInfo(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
         * Returns a list containing the name and current value of each client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
         * property supported by the driver.  The value of a client info property
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
         * may be null if the property has not been set and does not have a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
         * default value.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1245
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
         * @return      A <code>Properties</code> object that contains the name and current value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
         *                      each of the client info properties supported by the driver.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1248
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1249
         * @throws      SQLException if the database server returns an error when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1250
         *                      fetching the client info values from the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
         * or this method is called on a closed connection
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1252
         *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
         Properties getClientInfo()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
  * Factory method for creating Array objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
  *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
  * <b>Note: </b>When <code>createArrayOf</code> is used to create an array object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
  * that maps to a primitive data type, then it is implementation-defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
  * whether the <code>Array</code> object is an array of that primitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
  * data type or an array of <code>Object</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
  * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
  * <b>Note: </b>The JDBC driver is responsible for mapping the elements
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
  * <code>Object</code> array to the default JDBC SQL type defined in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
  * java.sql.Types for the given class of <code>Object</code>. The default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
  * mapping is specified in Appendix B of the JDBC specification.  If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
  * resulting JDBC type is not the appropriate type for the given typeName then
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
  * it is implementation defined whether an <code>SQLException</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
  * thrown or the driver supports the resulting conversion.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
  *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
  * @param typeName the SQL name of the type the elements of the array map to. The typeName is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
  * database-specific name which may be the name of a built-in type, a user-defined type or a standard  SQL type supported by this database. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
  *  is the value returned by <code>Array.getBaseTypeName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
  * @param elements the elements that populate the returned object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
  * @return an Array object whose elements map to the specified SQL type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
  * @throws SQLException if a database error occurs, the JDBC type is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
  *  appropriate for the typeName and the conversion is not supported, the typeName is null or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
  * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
  * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1283
  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
 Array createArrayOf(String typeName, Object[] elements) throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
  * Factory method for creating Struct objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
  *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
  * @param typeName the SQL type name of the SQL structured type that this <code>Struct</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
  * object maps to. The typeName is the name of  a user-defined type that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
  * has been defined for this database. It is the value returned by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
  * <code>Struct.getSQLTypeName</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
  * @param attributes the attributes that populate the returned object
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1296
  * @return a Struct object that maps to the given SQL type and is populated with the given attributes
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
  * @throws SQLException if a database error occurs, the typeName is null or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
  * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
  * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
 Struct createStruct(String typeName, Object[] attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
throws SQLException;
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1303
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1304
   //--------------------------JDBC 4.1 -----------------------------
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1305
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1306
   /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1307
    * Sets the given schema name to access.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1308
    * <P>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1309
    * If the driver does not support schemas, it will
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1310
    * silently ignore this request.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1311
    * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1312
    * Calling {@code setSchema} has no effect on previously created or prepared
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1313
    * {@code Statement} objects. It is implementation defined whether a DBMS
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1314
    * prepare operation takes place immediately when the {@code Connection}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1315
    * method {@code prepareStatement} or {@code prepareCall} is invoked.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1316
    * For maximum portability, {@code setSchema} should be called before a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1317
    * {@code Statement} is created or prepared.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1318
    *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1319
    * @param schema the name of a schema  in which to work
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1320
    * @exception SQLException if a database access error occurs
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1321
    * or this method is called on a closed connection
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1322
    * @see #getSchema
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1323
    * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1324
    */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1325
    void setSchema(String schema) throws SQLException;
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1326
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1327
    /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1328
     * Retrieves this <code>Connection</code> object's current schema name.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1329
     *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1330
     * @return the current schema name or <code>null</code> if there is none
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1331
     * @exception SQLException if a database access error occurs
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1332
     * or this method is called on a closed connection
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1333
     * @see #setSchema
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1334
     * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1335
     */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1336
    String getSchema() throws SQLException;
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1337
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1338
    /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1339
     * Terminates an open connection.  Calling <code>abort</code> results in:
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1340
     * <ul>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1341
     * <li>The connection marked as closed
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1342
     * <li>Closes any physical connection to the database
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1343
     * <li>Releases resources used by the connection
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1344
     * <li>Insures that any thread that is currently accessing the connection
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1345
     * will either progress to completion or throw an <code>SQLException</code>.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1346
     * </ul>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1347
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1348
     * Calling <code>abort</code> marks the connection closed and releases any
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1349
     * resources. Calling <code>abort</code> on a closed connection is a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1350
     * no-op.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1351
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1352
     * It is possible that the aborting and releasing of the resources that are
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1353
     * held by the connection can take an extended period of time.  When the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1354
     * <code>abort</code> method returns, the connection will have been marked as
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1355
     * closed and the <code>Executor</code> that was passed as a parameter to abort
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1356
     * may still be executing tasks to release resources.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1357
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1358
     * This method checks to see that there is an <code>SQLPermission</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1359
     * object before allowing the method to proceed.  If a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1360
     * <code>SecurityManager</code> exists and its
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1361
     * <code>checkPermission</code> method denies calling <code>abort</code>,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1362
     * this method throws a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1363
     * <code>java.lang.SecurityException</code>.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1364
     * @param executor  The <code>Executor</code>  implementation which will
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1365
     * be used by <code>abort</code>.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1366
     * @throws java.sql.SQLException if a database access error occurs or
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1367
     * the {@code executor} is {@code null},
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1368
     * @throws java.lang.SecurityException if a security manager exists and its
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1369
     *    <code>checkPermission</code> method denies calling <code>abort</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1370
     * @see SecurityManager#checkPermission
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1371
     * @see Executor
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1372
     * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1373
     */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1374
    void abort(Executor executor) throws SQLException;
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1375
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1376
    /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1377
     *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1378
     * Sets the maximum period a <code>Connection</code> or
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1379
     * objects created from the <code>Connection</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1380
     * will wait for the database to reply to any one request. If any
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1381
     *  request remains unanswered, the waiting method will
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1382
     * return with a <code>SQLException</code>, and the <code>Connection</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1383
     * or objects created from the <code>Connection</code>  will be marked as
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1384
     * closed. Any subsequent use of
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1385
     * the objects, with the exception of the <code>close</code>,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1386
     * <code>isClosed</code> or <code>Connection.isValid</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1387
     * methods, will result in  a <code>SQLException</code>.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1388
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1389
     * <b>Note</b>: This method is intended to address a rare but serious
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1390
     * condition where network partitions can cause threads issuing JDBC calls
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1391
     * to hang uninterruptedly in socket reads, until the OS TCP-TIMEOUT
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1392
     * (typically 10 minutes). This method is related to the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1393
     * {@link #abort abort() } method which provides an administrator
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1394
     * thread a means to free any such threads in cases where the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1395
     * JDBC connection is accessible to the administrator thread.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1396
     * The <code>setNetworkTimeout</code> method will cover cases where
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1397
     * there is no administrator thread, or it has no access to the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1398
     * connection. This method is severe in it's effects, and should be
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1399
     * given a high enough value so it is never triggered before any more
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1400
     * normal timeouts, such as transaction timeouts.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1401
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1402
     * JDBC driver implementations  may also choose to support the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1403
     * {@code setNetworkTimeout} method to impose a limit on database
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1404
     * response time, in environments where no network is present.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1405
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1406
     * Drivers may internally implement some or all of their API calls with
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1407
     * multiple internal driver-database transmissions, and it is left to the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1408
     * driver implementation to determine whether the limit will be
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1409
     * applied always to the response to the API call, or to any
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1410
     * single  request made during the API call.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1411
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1412
     *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1413
     * This method can be invoked more than once, such as to set a limit for an
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1414
     * area of JDBC code, and to reset to the default on exit from this area.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1415
     * Invocation of this method has no impact on already outstanding
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1416
     * requests.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1417
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1418
     * The {@code Statement.setQueryTimeout()} timeout value is independent of the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1419
     * timeout value specified in {@code setNetworkTimeout}. If the query timeout
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1420
     * expires  before the network timeout then the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1421
     * statement execution will be canceled. If the network is still
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1422
     * active the result will be that both the statement and connection
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1423
     * are still usable. However if the network timeout expires before
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1424
     * the query timeout or if the statement timeout fails due to network
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1425
     * problems, the connection will be marked as closed, any resources held by
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1426
     * the connection will be released and both the connection and
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1427
     * statement will be unusable.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 23010
diff changeset
  1428
     * <p>
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1429
     * When the driver determines that the {@code setNetworkTimeout} timeout
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1430
     * value has expired, the JDBC driver marks the connection
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1431
     * closed and releases any resources held by the connection.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1432
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1433
     *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1434
     * This method checks to see that there is an <code>SQLPermission</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1435
     * object before allowing the method to proceed.  If a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1436
     * <code>SecurityManager</code> exists and its
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1437
     * <code>checkPermission</code> method denies calling
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1438
     * <code>setNetworkTimeout</code>, this method throws a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1439
     * <code>java.lang.SecurityException</code>.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1440
     *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1441
     * @param executor  The <code>Executor</code>  implementation which will
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1442
     * be used by <code>setNetworkTimeout</code>.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1443
     * @param milliseconds The time in milliseconds to wait for the database
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1444
     * operation
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1445
     *  to complete.  If the JDBC driver does not support milliseconds, the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1446
     * JDBC driver will round the value up to the nearest second.  If the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1447
     * timeout period expires before the operation
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1448
     * completes, a SQLException will be thrown.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1449
     * A value of 0 indicates that there is not timeout for database operations.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1450
     * @throws java.sql.SQLException if a database access error occurs, this
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1451
     * method is called on a closed connection,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1452
     * the {@code executor} is {@code null},
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1453
     * or the value specified for <code>seconds</code> is less than 0.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1454
     * @throws java.lang.SecurityException if a security manager exists and its
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1455
     *    <code>checkPermission</code> method denies calling
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1456
     * <code>setNetworkTimeout</code>.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1457
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1458
     * this method
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1459
     * @see SecurityManager#checkPermission
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1460
     * @see Statement#setQueryTimeout
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1461
     * @see #getNetworkTimeout
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1462
     * @see #abort
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1463
     * @see Executor
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1464
     * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1465
     */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1466
    void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException;
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1467
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1468
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1469
    /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1470
     * Retrieves the number of milliseconds the driver will
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1471
     * wait for a database request to complete.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1472
     * If the limit is exceeded, a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1473
     * <code>SQLException</code> is thrown.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1474
     *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1475
     * @return the current timeout limit in milliseconds; zero means there is
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1476
     *         no limit
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1477
     * @throws SQLException if a database access error occurs or
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1478
     * this method is called on a closed <code>Connection</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1479
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1480
     * this method
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1481
     * @see #setNetworkTimeout
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1482
     * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1483
     */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1484
    int getNetworkTimeout() throws SQLException;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
}