jdk/src/share/classes/java/sql/Connection.java
author chegar
Tue, 12 May 2009 16:32:34 +0100
changeset 3450 2f08a8bb9b83
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
6801071: Remote sites can compromise user privacy and possibly hijack web sessions Reviewed-by: jccollet, hawtin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * <P>A connection (session) with a specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * database. SQL statements are executed and results are returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * within the context of a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * A <code>Connection</code> object's database is able to provide information
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * describing its tables, its supported SQL grammar, its stored
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * procedures, the capabilities of this connection, and so on. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * information is obtained with the <code>getMetaData</code> method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <P><B>Note:</B> When configuring a <code>Connection</code>, JDBC applications
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *  should use the appropritate <code>Connection</code> method such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *  <code>setAutoCommit</code> or <code>setTransactionIsolation</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *  Applications should not invoke SQL commands directly to change the connection's
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *   configuration when there is a JDBC method available.  By default a <code>Connection</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * auto-commit mode, which means that it automatically commits changes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * after executing each statement. If auto-commit mode has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * disabled, the method <code>commit</code> must be called explicitly in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * order to commit changes; otherwise, database changes will not be saved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * A new <code>Connection</code> object created using the JDBC 2.1 core API
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * has an initially empty type map associated with it. A user may enter a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * custom mapping for a UDT in this type map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * When a UDT is retrieved from a data source with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * method <code>ResultSet.getObject</code>, the <code>getObject</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * will check the connection's type map to see if there is an entry for that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * UDT.  If so, the <code>getObject</code> method will map the UDT to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * class indicated.  If there is no entry, the UDT will be mapped using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * standard mapping.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * A user may create a new type map, which is a <code>java.util.Map</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * object, make an entry in it, and pass it to the <code>java.sql</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * methods that can perform custom mapping.  In this case, the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * will use the given type map instead of the one associated with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * the connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * For example, the following code fragment specifies that the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * type <code>ATHLETES</code> will be mapped to the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * <code>Athletes</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * The code fragment retrieves the type map for the <code>Connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * </code> object <code>con</code>, inserts the entry into it, and then sets
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * the type map with the new entry as the connection's type map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 *      java.util.Map map = con.getTypeMap();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *      map.put("mySchemaName.ATHLETES", Class.forName("Athletes"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 *      con.setTypeMap(map);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * @see DriverManager#getConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * @see Statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * @see DatabaseMetaData
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
public interface Connection  extends Wrapper {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * Creates a <code>Statement</code> object for sending
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * SQL statements to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * SQL statements without parameters are normally
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * executed using <code>Statement</code> objects. If the same SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * is executed many times, it may be more efficient to use a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * <code>PreparedStatement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * Result sets created using the returned <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @return a new default <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    Statement createStatement() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * Creates a <code>PreparedStatement</code> object for sending
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * parameterized SQL statements to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * A SQL statement with or without IN parameters can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * pre-compiled and stored in a <code>PreparedStatement</code> object. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * object can then be used to efficiently execute this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * multiple times.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * <P><B>Note:</B> This method is optimized for handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * parametric SQL statements that benefit from precompilation. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * the driver supports precompilation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * the method <code>prepareStatement</code> will send
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * the statement to the database for precompilation. Some drivers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * may not support precompilation. In this case, the statement may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * not be sent to the database until the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * object is executed.  This has no direct effect on users; however, it does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * affect which methods throw certain <code>SQLException</code> objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * Result sets created using the returned <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @param sql an SQL statement that may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @return a new default <code>PreparedStatement</code> object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * pre-compiled SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    PreparedStatement prepareStatement(String sql)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * Creates a <code>CallableStatement</code> object for calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * database stored procedures.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * The <code>CallableStatement</code> object provides
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * methods for setting up its IN and OUT parameters, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * methods for executing the call to a stored procedure.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * <P><B>Note:</B> This method is optimized for handling stored
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * procedure call statements. Some drivers may send the call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * statement to the database when the method <code>prepareCall</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * is done; others
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * may wait until the <code>CallableStatement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * is executed. This has no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * direct effect on users; however, it does affect which method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * throws certain SQLExceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * Result sets created using the returned <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * @param sql an SQL statement that may contain one or more '?'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * parameter placeholders. Typically this statement is specified using JDBC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * call escape syntax.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * @return a new default <code>CallableStatement</code> object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * pre-compiled SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    CallableStatement prepareCall(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * Converts the given SQL statement into the system's native SQL grammar.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * A driver may convert the JDBC SQL grammar into its system's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * native SQL grammar prior to sending it. This method returns the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * native form of the statement that the driver would have sent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @param sql an SQL statement that may contain one or more '?'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * @return the native form of this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    String nativeSQL(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Sets this connection's auto-commit mode to the given state.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * If a connection is in auto-commit mode, then all its SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * statements will be executed and committed as individual
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * transactions.  Otherwise, its SQL statements are grouped into
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * transactions that are terminated by a call to either
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * the method <code>commit</code> or the method <code>rollback</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * By default, new connections are in auto-commit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * The commit occurs when the statement completes. The time when the statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * completes depends on the type of SQL Statement:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * <li>For DML statements, such as Insert, Update or Delete, and DDL statements,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * the statement is complete as soon as it has finished executing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * <li>For Select statements, the statement is complete when the associated result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * set is closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * <li>For <code>CallableStatement</code> objects or for statements that return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * multiple results, the statement is complete
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * when all of the associated result sets have been closed, and all update
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * counts and output parameters have been retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     *</ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * <B>NOTE:</B>  If this method is called during a transaction and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * auto-commit mode is changed, the transaction is committed.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * <code>setAutoCommit</code> is called and the auto-commit mode is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * not changed, the call is a no-op.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @param autoCommit <code>true</code> to enable auto-commit mode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     *         <code>false</code> to disable it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *  setAutoCommit(true) is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * @see #getAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    void setAutoCommit(boolean autoCommit) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * Retrieves the current auto-commit mode for this <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * @return the current state of this <code>Connection</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     *         auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @see #setAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    boolean getAutoCommit() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * Makes all changes made since the previous
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * commit/rollback permanent and releases any database locks
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * currently held by this <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * This method should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * used only when auto-commit mode has been disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * if this method is called on a closed conection or this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     *            <code>Connection</code> object is in auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @see #setAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    void commit() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * Undoes all changes made in the current transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * and releases any database locks currently held
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * by this <code>Connection</code> object. This method should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * used only when auto-commit mode has been disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * this method is called on a closed connection or this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     *            <code>Connection</code> object is in auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * @see #setAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    void rollback() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * Releases this <code>Connection</code> object's database and JDBC resources
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * immediately instead of waiting for them to be automatically released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * Calling the method <code>close</code> on a <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * object that is already closed is a no-op.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * It is <b>strongly recommended</b> that an application explicitly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * commits or rolls back an active transaction prior to calling the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * <code>close</code> method.  If the <code>close</code> method is called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * and there is an active transaction, the results are implementation-defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * @exception SQLException SQLException if a database access error occurs
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @exception SQLException SQLException if a database access error occurs
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.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * @param catalog the name of a catalog (subspace in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     *        <code>Connection</code> object's database) in which to work
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * @see #getCatalog
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    void setCatalog(String catalog) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * Retrieves this <code>Connection</code> object's current catalog name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * @return the current catalog name or <code>null</code> if there is none
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @see #setCatalog
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    String getCatalog() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * A constant indicating that transactions are not supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    int TRANSACTION_NONE             = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * A constant indicating that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * dirty reads, non-repeatable reads and phantom reads can occur.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * This level allows a row changed by one transaction to be read
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * by another transaction before any changes in that row have been
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * committed (a "dirty read").  If any of the changes are rolled back,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * the second transaction will have retrieved an invalid row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    int TRANSACTION_READ_UNCOMMITTED = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * A constant indicating that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * dirty reads are prevented; non-repeatable reads and phantom
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * reads can occur.  This level only prohibits a transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * from reading a row with uncommitted changes in it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    int TRANSACTION_READ_COMMITTED   = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * A constant indicating that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * dirty reads and non-repeatable reads are prevented; phantom
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * reads can occur.  This level prohibits a transaction from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * reading a row with uncommitted changes in it, and it also
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * prohibits the situation where one transaction reads a row,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * a second transaction alters the row, and the first transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * rereads the row, getting different values the second time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * (a "non-repeatable read").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    int TRANSACTION_REPEATABLE_READ  = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * A constant indicating that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * dirty reads, non-repeatable reads and phantom reads are prevented.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * This level includes the prohibitions in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * <code>TRANSACTION_REPEATABLE_READ</code> and further prohibits the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * situation where one transaction reads all rows that satisfy
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * a <code>WHERE</code> condition, a second transaction inserts a row that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * satisfies that <code>WHERE</code> condition, and the first transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * rereads for the same condition, retrieving the additional
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * "phantom" row in the second read.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    int TRANSACTION_SERIALIZABLE     = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * Attempts to change the transaction isolation level for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * <code>Connection</code> object to the one given.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * The constants defined in the interface <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * are the possible transaction isolation levels.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * <B>Note:</B> If this method is called during a transaction, the result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * is implementation-defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * @param level one of the following <code>Connection</code> constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     *        <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     *        <code>Connection.TRANSACTION_READ_COMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *        <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     *        <code>Connection.TRANSACTION_SERIALIZABLE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     *        (Note that <code>Connection.TRANSACTION_NONE</code> cannot be used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     *        because it specifies that transactions are not supported.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     *            or the given parameter is not one of the <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     *            constants
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * @see DatabaseMetaData#supportsTransactionIsolationLevel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * @see #getTransactionIsolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    void setTransactionIsolation(int level) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * Retrieves this <code>Connection</code> object's current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * transaction isolation level.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * @return the current transaction isolation level, which will be one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     *         of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     *        <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     *        <code>Connection.TRANSACTION_READ_COMMITTED</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     *        <code>Connection.TRANSACTION_REPEATABLE_READ</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     *        <code>Connection.TRANSACTION_SERIALIZABLE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     *        <code>Connection.TRANSACTION_NONE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * @see #setTransactionIsolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    int getTransactionIsolation() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * Retrieves the first warning reported by calls on this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * <code>Connection</code> object.  If there is more than one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * warning, subsequent warnings will be chained to the first one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * and can be retrieved by calling the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * <code>SQLWarning.getNextWarning</code> on the warning
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * that was retrieved previously.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * This method may not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * called on a closed connection; doing so will cause an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * <code>SQLException</code> to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * <P><B>Note:</B> Subsequent warnings will be chained to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * SQLWarning.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @return the first <code>SQLWarning</code> object or <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     *         if there are none
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     *            this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * @see SQLWarning
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
    SQLWarning getWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * Clears all warnings reported for this <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * After a call to this method, the method <code>getWarnings</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * returns <code>null</code> until a new warning is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * reported for this <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * @exception SQLException SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
    void clearWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
    //--------------------------JDBC 2.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * Creates a <code>Statement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * <code>ResultSet</code> objects with the given type and concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * This method is the same as the <code>createStatement</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * type and concurrency to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * @param resultSetType a result set type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     *        <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     *        <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     *        <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * @param resultSetConcurrency a concurrency type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     *        <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     *        <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * @return a new <code>Statement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     *         <code>ResultSet</code> objects with the given type and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     *         concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     *         or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     *         constants indicating type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * set type and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
    Statement createStatement(int resultSetType, int resultSetConcurrency)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * Creates a <code>PreparedStatement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * <code>ResultSet</code> objects with the given type and concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * This method is the same as the <code>prepareStatement</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * type and concurrency to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * @param sql a <code>String</code> object that is the SQL statement to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     *            be sent to the database; may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     *            parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * @param resultSetType a result set type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * @param resultSetConcurrency a concurrency type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * @return a new PreparedStatement object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * pre-compiled SQL statement that will produce <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * objects with the given type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     *         or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     *         constants indicating type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * set type and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    PreparedStatement prepareStatement(String sql, int resultSetType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
                                       int resultSetConcurrency)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * Creates a <code>CallableStatement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * <code>ResultSet</code> objects with the given type and concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * This method is the same as the <code>prepareCall</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * type and concurrency to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * @param sql a <code>String</code> object that is the SQL statement to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     *            be sent to the database; may contain on or more '?' parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * @param resultSetType a result set type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * @param resultSetConcurrency a concurrency type; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * @return a new <code>CallableStatement</code> object containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     * pre-compiled SQL statement that will produce <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     * objects with the given type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * @exception SQLException if a database access error occurs, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     *         or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     *         constants indicating type and concurrency
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * set type and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
    CallableStatement prepareCall(String sql, int resultSetType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
                                  int resultSetConcurrency) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * Retrieves the <code>Map</code> object associated with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * Unless the application has added an entry, the type map returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     * will be empty.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * @return the <code>java.util.Map</code> object associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     *         with this <code>Connection</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     * @see #setTypeMap
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
    java.util.Map<String,Class<?>> getTypeMap() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     * Installs the given <code>TypeMap</code> object as the type map for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * this <code>Connection</code> object.  The type map will be used for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * custom mapping of SQL structured types and distinct types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * @param map the <code>java.util.Map</code> object to install
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     *        as the replacement for this <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     *        object's default type map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * method is called on a closed connection or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     *        the given parameter is not a <code>java.util.Map</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     *        object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
     * @see #getTypeMap
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
    void setTypeMap(java.util.Map<String,Class<?>> map) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
    //--------------------------JDBC 3.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
     * Changes the default holdability of <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     * created using this <code>Connection</code> object to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * holdability.  The default holdability of <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * can be be determined by invoking
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * {@link DatabaseMetaData#getResultSetHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     * @param holdability a <code>ResultSet</code> holdability constant; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     *        <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     *        <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     * @throws SQLException if a database access occurs, this method is called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * on a closed connection, or the given parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     *         is not a <code>ResultSet</code> constant indicating holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * @exception SQLFeatureNotSupportedException if the given holdability is not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * @see #getHoldability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     * @see DatabaseMetaData#getResultSetHoldability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
    void setHoldability(int holdability) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * Retrieves the current holdability of <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     * created using this <code>Connection</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * @return the holdability, one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     *        <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     *        <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * @throws SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * @see #setHoldability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * @see DatabaseMetaData#getResultSetHoldability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
    int getHoldability() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     * Creates an unnamed savepoint in the current transaction and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     * returns the new <code>Savepoint</code> object that represents it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     *<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
   677
     *savepoint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * @return the new <code>Savepoint</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     *            or this <code>Connection</code> object is currently in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     *            auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     * @see Savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
    Savepoint setSavepoint() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * Creates a savepoint with the given name in the current transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * and returns the new <code>Savepoint</code> object that represents it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     * <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
   697
     *savepoint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * @param name a <code>String</code> containing the name of the savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * @return the new <code>Savepoint</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
          * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     * this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     *            or this <code>Connection</code> object is currently in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     *            auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * @see Savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
    Savepoint setSavepoint(String name) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     * Undoes all changes made after the given <code>Savepoint</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     * was set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
     * This method should be used only when auto-commit has been disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * @param savepoint the <code>Savepoint</code> object to roll back to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * this method is called while participating in a distributed transaction,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * this method is called on a closed connection,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     *            the <code>Savepoint</code> object is no longer valid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     *            or this <code>Connection</code> object is currently in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     *            auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     * @see Savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * @see #rollback
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
    void rollback(Savepoint savepoint) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
     * Removes the specified <code>Savepoint</code>  and subsequent <code>Savepoint</code> objects from the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     * transaction. Any reference to the savepoint after it have been removed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
     * will cause an <code>SQLException</code> to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     * @param savepoint the <code>Savepoint</code> object to be removed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     *  method is called on a closed connection or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
     *            the given <code>Savepoint</code> object is not a valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     *            savepoint in the current transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
    void releaseSavepoint(Savepoint savepoint) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * Creates a <code>Statement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     * <code>ResultSet</code> objects with the given type, concurrency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     * and holdability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     * This method is the same as the <code>createStatement</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     * type, concurrency, and holdability to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     * @param resultSetType one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * @param resultSetConcurrency one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     * @param resultSetHoldability one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     *         <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * @return a new <code>Statement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     *         <code>ResultSet</code> objects with the given type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     *         concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     *            or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     *            constants indicating type, concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     * set type, result set holdability and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
    Statement createStatement(int resultSetType, int resultSetConcurrency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
                              int resultSetHoldability) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     * Creates a <code>PreparedStatement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * <code>ResultSet</code> objects with the given type, concurrency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     * and holdability.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     * This method is the same as the <code>prepareStatement</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * type, concurrency, and holdability to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * @param sql a <code>String</code> object that is the SQL statement to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     *            be sent to the database; may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     *            parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     * @param resultSetType one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
     * @param resultSetConcurrency one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     * @param resultSetHoldability one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
     *         <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
     * @return a new <code>PreparedStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     *         pre-compiled SQL statement, that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     *         <code>ResultSet</code> objects with the given type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     *         concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     *            or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     *            constants indicating type, concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * set type, result set holdability and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
    PreparedStatement prepareStatement(String sql, int resultSetType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
                                       int resultSetConcurrency, int resultSetHoldability)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * Creates a <code>CallableStatement</code> object that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * <code>ResultSet</code> objects with the given type and concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     * This method is the same as the <code>prepareCall</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * above, but it allows the default result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     * type, result set concurrency type and holdability to be overridden.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     * @param sql a <code>String</code> object that is the SQL statement to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     *            be sent to the database; may contain on or more '?' parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * @param resultSetType one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     *         <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     *         <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     *         <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     * @param resultSetConcurrency one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     *         <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     *         <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * @param resultSetHoldability one of the following <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     *        constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     *         <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * @return a new <code>CallableStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     *         pre-compiled SQL statement, that will generate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     *         <code>ResultSet</code> objects with the given type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     *         concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     * method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     *            or the given parameters are not <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     *            constants indicating type, concurrency, and holdability
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
      * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     * this method or this method is not supported for the specified result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
     * set type, result set holdability and result set concurrency.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
    CallableStatement prepareCall(String sql, int resultSetType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
                                  int resultSetConcurrency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
                                  int resultSetHoldability) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     * Creates a default <code>PreparedStatement</code> object that has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     * the capability to retrieve auto-generated keys. The given constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * tells the driver whether it should make auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     * available for retrieval.  This parameter is ignored if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     * <B>Note:</B> This method is optimized for handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     * parametric SQL statements that benefit from precompilation. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * the driver supports precompilation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     * the method <code>prepareStatement</code> will send
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * the statement to the database for precompilation. Some drivers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     * may not support precompilation. In this case, the statement may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     * not be sent to the database until the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * object is executed.  This has no direct effect on users; however, it does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * affect which methods throw certain SQLExceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * Result sets created using the returned <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
     * @param sql an SQL statement that may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
     *        parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
     * @param autoGeneratedKeys a flag indicating whether auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     *        should be returned; one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
     *        <code>Statement.RETURN_GENERATED_KEYS</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     *        <code>Statement.NO_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
     * @return a new <code>PreparedStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     *         pre-compiled SQL statement, that will have the capability of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     *         returning auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     * @exception SQLException if a database access error occurs, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     *  method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     *         or the given parameter is not a <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
     *         constant indicating whether auto-generated keys should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
     *         returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
    PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
     * Creates a default <code>PreparedStatement</code> object capable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
     * of returning the auto-generated keys designated by the given array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * This array contains the indexes of the columns in the target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     * table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     * available.  The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     * An SQL statement with or without IN parameters can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * pre-compiled and stored in a <code>PreparedStatement</code> object. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * object can then be used to efficiently execute this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     * multiple times.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * <B>Note:</B> This method is optimized for handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     * parametric SQL statements that benefit from precompilation. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
     * the driver supports precompilation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
     * the method <code>prepareStatement</code> will send
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
     * the statement to the database for precompilation. Some drivers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     * may not support precompilation. In this case, the statement may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
     * not be sent to the database until the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     * object is executed.  This has no direct effect on users; however, it does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     * affect which methods throw certain SQLExceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
     * Result sets created using the returned <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     * @param sql an SQL statement that may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
     *        parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
     * @param columnIndexes an array of column indexes indicating the columns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
     *        that should be returned from the inserted row or rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     * @return a new <code>PreparedStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     *         pre-compiled statement, that is capable of returning the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     *         auto-generated keys designated by the given array of column
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     *         indexes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
    PreparedStatement prepareStatement(String sql, int columnIndexes[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
     * Creates a default <code>PreparedStatement</code> object capable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
     * of returning the auto-generated keys designated by the given array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
     * This array contains the names of the columns in the target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     * table that contain the auto-generated keys that should be returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     * The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     * An SQL statement with or without IN parameters can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     * pre-compiled and stored in a <code>PreparedStatement</code> object. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     * object can then be used to efficiently execute this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
     * multiple times.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     * <B>Note:</B> This method is optimized for handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     * parametric SQL statements that benefit from precompilation. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     * the driver supports precompilation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
     * the method <code>prepareStatement</code> will send
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
     * the statement to the database for precompilation. Some drivers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
     * may not support precompilation. In this case, the statement may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
     * not be sent to the database until the <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
     * object is executed.  This has no direct effect on users; however, it does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * affect which methods throw certain SQLExceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * Result sets created using the returned <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     * object will by default be type <code>TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
     * and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * The holdability of the created result sets can be determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     * calling {@link #getHoldability}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
     * @param sql an SQL statement that may contain one or more '?' IN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
     *        parameter placeholders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
     * @param columnNames an array of column names indicating the columns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
     *        that should be returned from the inserted row or rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
     * @return a new <code>PreparedStatement</code> object, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
     *         pre-compiled statement, that is capable of returning the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
     *         auto-generated keys designated by the given array of column
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
     *         names
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
     * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
    PreparedStatement prepareStatement(String sql, String columnNames[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     * Constructs an object that implements the <code>Clob</code> interface. The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     * returned initially contains no data.  The <code>setAsciiStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     * <code>setCharacterStream</code> and <code>setString</code> methods of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     * the <code>Clob</code> interface may be used to add data to the <code>Clob</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     * @return An object that implements the <code>Clob</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * @throws SQLException if an object that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     * <code>Clob</code> interface can not be constructed, this method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
     * called on a closed connection or a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
    Clob createClob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
     * Constructs an object that implements the <code>Blob</code> interface. The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
     * returned initially contains no data.  The <code>setBinaryStream</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     * <code>setBytes</code> methods of the <code>Blob</code> interface may be used to add data to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     * the <code>Blob</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
     * @return  An object that implements the <code>Blob</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
     * @throws SQLException if an object that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
     * <code>Blob</code> interface can not be constructed, this method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
     * called on a closed connection or a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
    Blob createBlob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
     * Constructs an object that implements the <code>NClob</code> interface. The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
     * returned initially contains no data.  The <code>setAsciiStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
     * <code>setCharacterStream</code> and <code>setString</code> methods of the <code>NClob</code> interface may
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
     * be used to add data to the <code>NClob</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
     * @return An object that implements the <code>NClob</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
     * @throws SQLException if an object that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
     * <code>NClob</code> interface can not be constructed, this method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
     * called on a closed connection or a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
    NClob createNClob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
     * Constructs an object that implements the <code>SQLXML</code> interface. The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
     * returned initially contains no data. The <code>createXmlStreamWriter</code> object and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
     * <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
  1064
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
     * @return An object that implements the <code>SQLXML</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
     * @throws SQLException if an object that implements the <code>SQLXML</code> interface can not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
     * be constructed, this method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
     * called on a closed connection or a database access error occurs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
    SQLXML createSQLXML() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
         * Returns true if the connection has not been closed and is still valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
         * The driver shall submit a query on the connection or use some other
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
         * mechanism that positively verifies the connection is still valid when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
         * this method is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
         * The query submitted by the driver to validate the connection shall be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
         * executed in the context of the current transaction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
         * @param timeout -             The time in seconds to wait for the database operation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
         *                                              used to validate the connection to complete.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
         *                                              the timeout period expires before the operation
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
         *                                              completes, this method returns false.  A value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
         *                                              0 indicates a timeout is not applied to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
         *                                              database operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
         * @return true if the connection is valid, false otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
         * @exception SQLException if the value supplied for <code>timeout</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
         * is less then 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
         * @see java.sql.DatabaseMetaData#getClientInfoProperties
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
         boolean isValid(int timeout) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
         * Sets the value of the client info property specified by name to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
         * value specified by value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
         * Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
         * method to determine the client info properties supported by the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
         * and the maximum length that may be specified for each property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
         * The driver stores the value specified in a suitable location in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
         * database.  For example in a special register, session parameter, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
         * system table column.  For efficiency the driver may defer setting the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
         * value in the database until the next time a statement is executed or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
         * prepared.  Other than storing the client information in the appropriate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
         * place in the database, these methods shall not alter the behavior of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
         * the connection in anyway.  The values supplied to these methods are
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
         * used for accounting, diagnostics and debugging purposes only.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
         * The driver shall generate a warning if the client info name specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
         * is not recognized by the driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
         * If the value specified to this method is greater than the maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
         * length for the property the driver may either truncate the value and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
         * generate a warning or generate a <code>SQLClientInfoException</code>.  If the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
         * generates a <code>SQLClientInfoException</code>, the value specified was not set on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
         * connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
         * The following are standard client info properties.  Drivers are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
         * required to support these properties however if the driver supports a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
         * client info property that can be described by one of the standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
         * properties, the standard property name should be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
         * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
         * <li>ApplicationName  -       The name of the application currently utilizing
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
         *                                                      the connection</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
         * <li>ClientUser               -       The name of the user that the application using
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
         *                                                      the connection is performing work for.  This may
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
         *                                                      not be the same as the user name that was used
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
         *                                                      in establishing the connection.</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
         * <li>ClientHostname   -       The hostname of the computer the application
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
         *                                                      using the connection is running on.</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
         * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
         * @param name          The name of the client info property to set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
         * @param value         The value to set the client info property to.  If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
         *                                      value is null, the current value of the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
         *                                      property is cleared.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
         * @throws      SQLClientInfoException if the database server returns an error while
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
         *                      setting the client info value on the database server or this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
         * is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
         void setClientInfo(String name, String value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
                throws SQLClientInfoException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
     * Sets the value of the connection's client info properties.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
     * <code>Properties</code> object contains the names and values of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
     * properties to be set.  The set of client info properties contained in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
     * the properties list replaces the current set of client info properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
     * on the connection.  If a property that is currently set on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
     * connection is not present in the properties list, that property is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
     * cleared.  Specifying an empty properties list will clear all of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
     * properties on the connection.  See <code>setClientInfo (String, String)</code> for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
     * more information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
     * If an error occurs in setting any of the client info properties, a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
     * <code>SQLClientInfoException</code> is thrown. The <code>SQLClientInfoException</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
     * contains information indicating which client info properties were not set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
     * The state of the client information is unknown because
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
     * some databases do not allow multiple client info properties to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
     * atomically.  For those databases, one or more properties may have been
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
     * set before the error occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
     * @param properties                the list of client info properties to set
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
     * @see java.sql.Connection#setClientInfo(String, String) setClientInfo(String, String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
     * @throws SQLClientInfoException if the database server returns an error while
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
     *                  setting the clientInfo values on the database server or this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
     * is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
         void setClientInfo(Properties properties)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
                throws SQLClientInfoException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
         * Returns the value of the client info property specified by name.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
         * method may return null if the specified client info property has not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
         * been set and does not have a default value.  This method will also
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
         * return null if the specified client info property name is not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
         * by the driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
         * Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
         * method to determine the client info properties supported by the driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
         * @param name          The name of the client info property to retrieve
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
         * @return                      The value of the client info property specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
         * @throws SQLException         if the database server returns an error when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
         *                                                      fetching the client info value from the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
         *or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
         * @see java.sql.DatabaseMetaData#getClientInfoProperties
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
         String getClientInfo(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
         * Returns a list containing the name and current value of each client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
         * property supported by the driver.  The value of a client info property
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
         * may be null if the property has not been set and does not have a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
         * default value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
         * @return      A <code>Properties</code> object that contains the name and current value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
         *                      each of the client info properties supported by the driver.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
         * @throws      SQLException if the database server returns an error when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
         *                      fetching the client info values from the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
         * or this method is called on a closed connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
         Properties getClientInfo()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
  * Factory method for creating Array objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
  *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
  * <b>Note: </b>When <code>createArrayOf</code> is used to create an array object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
  * that maps to a primitive data type, then it is implementation-defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
  * whether the <code>Array</code> object is an array of that primitive
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
  * data type or an array of <code>Object</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
  * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
  * <b>Note: </b>The JDBC driver is responsible for mapping the elements
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
  * <code>Object</code> array to the default JDBC SQL type defined in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
  * java.sql.Types for the given class of <code>Object</code>. The default
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
  * mapping is specified in Appendix B of the JDBC specification.  If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
  * resulting JDBC type is not the appropriate type for the given typeName then
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
  * it is implementation defined whether an <code>SQLException</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
  * thrown or the driver supports the resulting conversion.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
  *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
  * @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
  1249
  * 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
  1250
  *  is the value returned by <code>Array.getBaseTypeName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
  * @param elements the elements that populate the returned object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
  * @return an Array object whose elements map to the specified SQL type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
  * @throws SQLException if a database error occurs, the JDBC type is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
  *  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
  1255
  * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
  * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
 Array createArrayOf(String typeName, Object[] elements) throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
  * Factory method for creating Struct objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
  *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
  * @param typeName the SQL type name of the SQL structured type that this <code>Struct</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
  * object maps to. The typeName is the name of  a user-defined type that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
  * has been defined for this database. It is the value returned by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
  * <code>Struct.getSQLTypeName</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
  * @param attributes the attributes that populate the returned object
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
  *  @return a Struct object that maps to the given SQL type and is populated with the given attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
  * @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
  1272
  * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
  * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
 Struct createStruct(String typeName, Object[] attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
}