src/java.sql.rowset/share/classes/javax/sql/rowset/JdbcRowSet.java
author ascarpino
Sun, 13 May 2018 08:52:25 -0700
branchJDK-8145252-TLS13-branch
changeset 56544 ad120e0dfcfb
parent 47216 71c04702a3d5
child 54106 9a90236ab64c
permissions -rw-r--r--
start/beginHandshake and more post-handshake changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 20880
diff changeset
     2
 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.sql.rowset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.naming.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.math.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * The standard interface that all standard implementations of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <code>JdbcRowSet</code> must implement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <h3>1.0 Overview</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * A wrapper around a <code>ResultSet</code> object that makes it possible
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 5506
diff changeset
    41
 * to use the result set as a JavaBeans&trade;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * component.  Thus, a <code>JdbcRowSet</code> object can be one of the Beans that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * a tool makes available for composing an application.  Because
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * a <code>JdbcRowSet</code> is a connected rowset, that is, it continually
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * maintains its connection to a database using a JDBC technology-enabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * driver, it also effectively makes the driver a JavaBeans component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * Because it is always connected to its database, an instance of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <code>JdbcRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * can simply take calls invoked on it and in turn call them on its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <code>ResultSet</code> object. As a consequence, a result set can, for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * example, be a component in a Swing application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * Another advantage of a <code>JdbcRowSet</code> object is that it can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * used to make a <code>ResultSet</code> object scrollable and updatable.  All
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * <code>RowSet</code> objects are by default scrollable and updatable. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * the driver and database being used do not support scrolling and/or updating
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * of result sets, an application can populate a <code>JdbcRowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * with the data of a <code>ResultSet</code> object and then operate on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * <code>JdbcRowSet</code> object as if it were the <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * object.
20880
1b610151b316 8026812: doclint clean up for java.sql and javax.sql
lancea
parents: 18564
diff changeset
    62
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * <h3>2.0 Creating a <code>JdbcRowSet</code> Object</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * The reference implementation of the <code>JdbcRowSet</code> interface,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <code>JdbcRowSetImpl</code>, provides an implementation of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * the default constructor.  A new instance is initialized with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * default values, which can be set with new values as needed. A
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * new instance is not really functional until its <code>execute</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * method is called. In general, this method does the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 *   <LI> establishes a connection with a database
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *   <LI> creates a <code>PreparedStatement</code> object and sets any of its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 *        placeholder parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *   <LI> executes the statement to create a <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * If the <code>execute</code> method is successful, it will set the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * appropriate private <code>JdbcRowSet</code> fields with the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 *  <LI> a <code>Connection</code> object -- the connection between the rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 *       and the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 *  <LI> a <code>PreparedStatement</code> object -- the query that produces
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 *       the result set
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 *  <LI> a <code>ResultSet</code> object -- the result set that the rowset's
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 *       command produced and that is being made, in effect, a JavaBeans
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 *       component
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * </UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * If these fields have not been set, meaning that the <code>execute</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * method has not executed successfully, no methods other than
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * <code>execute</code> and <code>close</code> may be called on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * rowset.  All other public methods will throw an exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * Before calling the <code>execute</code> method, however, the command
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * and properties needed for establishing a connection must be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * The following code fragment creates a <code>JdbcRowSetImpl</code> object,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * sets the command and connection properties, sets the placeholder parameter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * and then invokes the method <code>execute</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 *     JdbcRowSetImpl jrs = new JdbcRowSetImpl();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 *     jrs.setCommand("SELECT * FROM TITLES WHERE TYPE = ?");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 *     jrs.setURL("jdbc:myDriver:myAttribute");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 *     jrs.setUsername("cervantes");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 *     jrs.setPassword("sancho");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 *     jrs.setString(1, "BIOGRAPHY");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 *     jrs.execute();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * The variable <code>jrs</code> now represents an instance of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * <code>JdbcRowSetImpl</code> that is a thin wrapper around the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 * <code>ResultSet</code> object containing all the rows in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * table <code>TITLES</code> where the type of book is biography.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 * At this point, operations called on <code>jrs</code> will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 * affect the rows in the result set, which is effectively a JavaBeans
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 * component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 * The implementation of the <code>RowSet</code> method <code>execute</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * <code>JdbcRowSet</code> reference implementation differs from that in the
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 5506
diff changeset
   116
 * <code>CachedRowSet</code>&trade;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 * reference implementation to account for the different
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * requirements of connected and disconnected <code>RowSet</code> objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * @author Jonathan Bruce
24968
3308660aa3f2 8046389: Add missing @since tag under javax.sql.**
henryjen
parents: 24197
diff changeset
   121
 * @since 1.5
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
public interface JdbcRowSet extends RowSet, Joinable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * Retrieves a <code>boolean</code> indicating whether rows marked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * for deletion appear in the set of current rows. If <code>true</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * returned, deleted rows are visible with the current rows. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * <code>false</code> is returned, rows are not visible with the set of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * current rows. The default value is <code>false</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * Standard rowset implementations may choose to restrict this behavior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * for security considerations or for certain deployment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * scenarios. The visibility of deleted rows is implementation-defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * and does not represent standard behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * Note: Allowing deleted rows to remain visible complicates the behavior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * of some standard JDBC <code>RowSet</code> implementations methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * However, most rowset users can simply ignore this extra detail because
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * only very specialized applications will likely want to take advantage of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * this feature.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * @return <code>true</code> if deleted rows are visible;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     *         <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * @exception SQLException if a rowset implementation is unable to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     *          to determine whether rows marked for deletion remain visible
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @see #setShowDeleted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    public boolean getShowDeleted() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Sets the property <code>showDeleted</code> to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * <code>boolean</code> value. This property determines whether
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * rows marked for deletion continue to appear in the set of current rows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * If the value is set to <code>true</code>, deleted rows are immediately
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * visible with the set of current rows. If the value is set to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * <code>false</code>, the deleted rows are set as invisible with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * current set of rows.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * Standard rowset implementations may choose to restrict this behavior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * for security considerations or for certain deployment
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * scenarios. This is left as implementation-defined and does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * represent standard behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @param b <code>true</code> if deleted rows should be shown;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     *              <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * @exception SQLException if a rowset implementation is unable to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     *          to reset whether deleted rows should be visible
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * @see #getShowDeleted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    public void setShowDeleted(boolean b) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * Retrieves the first warning reported by calls on this <code>JdbcRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * If a second warning was reported on this <code>JdbcRowSet</code> object,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * it will be chained to the first warning and can be retrieved by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * calling the method <code>RowSetWarning.getNextWarning</code> on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * first warning. Subsequent warnings on this <code>JdbcRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * object will be chained to the <code>RowSetWarning</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * returned by the method <code>RowSetWarning.getNextWarning</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * The warning chain is automatically cleared each time a new row is read.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * This method may not be called on a <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * that has been closed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * doing so will cause an <code>SQLException</code> to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * Because it is always connected to its data source, a <code>JdbcRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * object can rely on the presence of active
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * <code>Statement</code>, <code>Connection</code>, and <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * instances. This means that  applications can obtain additional
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * <code>SQLWarning</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * notifications by calling the <code>getNextWarning</code> methods that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * they provide.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * Disconnected <code>Rowset</code> objects, such as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * <code>CachedRowSet</code> object, do not have access to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * these <code>getNextWarning</code> methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * @return the first <code>RowSetWarning</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * object reported on this <code>JdbcRowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * or <code>null</code> if there are none
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @throws SQLException if this method is called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * <code>JdbcRowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * @see RowSetWarning
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    public RowSetWarning getRowSetWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    * Each <code>JdbcRowSet</code> contains a <code>Connection</code> object from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    * the <code>ResultSet</code> or JDBC properties passed to it's constructors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    * This method wraps the <code>Connection</code> commit method to allow flexible
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    * auto commit or non auto commit transactional control support.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    * Makes all changes made since the previous commit/rollback permanent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    * and releases any database locks currently held by this Connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    * object. This method should be used only when auto-commit mode has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    * been disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    * @throws SQLException if a database access error occurs or this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    * Connection object within this <code>JdbcRowSet</code> is in auto-commit mode
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    * @see java.sql.Connection#setAutoCommit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    public void commit() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    * Each <code>JdbcRowSet</code> contains a <code>Connection</code> object from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    * the original <code>ResultSet</code> or JDBC properties passed to it. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    * method wraps the <code>Connection</code>'s <code>getAutoCommit</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    * to allow an application to determine the <code>JdbcRowSet</code> transaction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    * behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    * Sets this connection's auto-commit mode to the given state. If a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    * connection is in auto-commit mode, then all its SQL statements will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    * be executed and committed as individual transactions. Otherwise, its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    * SQL statements are grouped into transactions that are terminated by a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    * call to either the method commit or the method rollback. By default,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    * new connections are in auto-commit mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    *
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 5506
diff changeset
   241
    * @return {@code true} if auto-commit is enabled; {@code false} otherwise
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    * @throws SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    * @see java.sql.Connection#getAutoCommit()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    public boolean getAutoCommit() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    * Each <code>JdbcRowSet</code> contains a <code>Connection</code> object from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    * the original <code>ResultSet</code> or JDBC properties passed to it. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    * method wraps the <code>Connection</code>'s <code>getAutoCommit</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    * to allow an application to set the <code>JdbcRowSet</code> transaction behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    * Sets the current auto-commit mode for this <code>Connection</code> object.
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 5506
diff changeset
   255
    * @param autoCommit {@code true} to enable auto-commit; {@code false} to
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 5506
diff changeset
   256
    * disable auto-commit
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    * @throws SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    * @see java.sql.Connection#setAutoCommit(boolean)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    public void setAutoCommit(boolean autoCommit) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * Each <code>JdbcRowSet</code> contains a <code>Connection</code> object from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * the original <code>ResultSet</code> or JDBC properties passed to it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * Undoes all changes made in the current transaction and releases any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * database locks currently held by this <code>Connection</code> object. This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * should be used only when auto-commit mode has been disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * @throws SQLException if a database access error occurs or this <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * object within this <code>JdbcRowSet</code> is in auto-commit mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * @see #rollback(Savepoint)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     public void rollback() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * Each <code>JdbcRowSet</code> contains a <code>Connection</code> object from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * the original <code>ResultSet</code> or JDBC properties passed to it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * Undoes all changes made in the current transaction to the last set savepoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * and releases any database locks currently held by this <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * object. This method should be used only when auto-commit mode has been disabled.
18564
f9db68ff2cbb 8017471: Fix JDBC -Xdoclint public errors
lancea
parents: 5506
diff changeset
   282
     * @param s The {@code Savepoint} to rollback to
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * @throws SQLException if a database access error occurs or this <code>Connection</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * object within this <code>JdbcRowSet</code> is in auto-commit mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * @see #rollback
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    public void rollback(Savepoint s) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
}