1 /*
2  * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package javax.sql;
27 
28 import java.sql.*;
29 
30 /**
31  * The interface that a <code>RowSet</code> object implements in order to
32  * present itself to a <code>RowSetReader</code> or <code>RowSetWriter</code>
33  * object. The <code>RowSetInternal</code> interface contains
34  * methods that let the reader or writer access and modify the internal
35  * state of the rowset.
36  *
37  * @since 1.4
38  */
39 
40 public interface RowSetInternal {
41 
42   /**
43    * Retrieves the parameters that have been set for this
44    * <code>RowSet</code> object's command.
45    *
46    * @return an array of the current parameter values for this <code>RowSet</code>
47    *         object's command
48    * @exception SQLException if a database access error occurs
49    */
getParams()50   Object[] getParams() throws SQLException;
51 
52   /**
53    * Retrieves the <code>Connection</code> object that was passed to this
54    * <code>RowSet</code> object.
55    *
56    * @return the <code>Connection</code> object passed to the rowset
57    *      or <code>null</code> if none was passed
58    * @exception SQLException if a database access error occurs
59    */
getConnection()60   Connection getConnection() throws SQLException;
61 
62   /**
63    * Sets the given <code>RowSetMetaData</code> object as the
64    * <code>RowSetMetaData</code> object for this <code>RowSet</code>
65    * object. The <code>RowSetReader</code> object associated with the rowset
66    * will use <code>RowSetMetaData</code> methods to set the values giving
67    * information about the rowset's columns.
68    *
69    * @param md the <code>RowSetMetaData</code> object that will be set with
70    *        information about the rowset's columns
71    *
72    * @exception SQLException if a database access error occurs
73    */
setMetaData(RowSetMetaData md)74   void setMetaData(RowSetMetaData md) throws SQLException;
75 
76   /**
77    * Retrieves a <code>ResultSet</code> object containing the original
78    * value of this <code>RowSet</code> object.
79    * <P>
80    * The cursor is positioned before the first row in the result set.
81    * Only rows contained in the result set returned by the method
82    * <code>getOriginal</code> are said to have an original value.
83    *
84    * @return the original value of the rowset
85    * @exception SQLException if a database access error occurs
86    */
getOriginal()87   public ResultSet getOriginal() throws SQLException;
88 
89   /**
90    * Retrieves a <code>ResultSet</code> object containing the original value
91    * of the current row only.  If the current row has no original value,
92    * an empty result set is returned. If there is no current row,
93    * an exception is thrown.
94    *
95    * @return the original value of the current row as a <code>ResultSet</code>
96    *          object
97    * @exception SQLException if a database access error occurs or this method
98    *           is called while the cursor is on the insert row, before the
99    *           first row, or after the last row
100    */
getOriginalRow()101   public ResultSet getOriginalRow() throws SQLException;
102 
103 }
104