jdk/src/share/classes/javax/sql/rowset/WebRowSet.java
author lancea
Fri, 02 Dec 2011 19:33:54 -0500
changeset 11129 f9ad1aadf3fa
parent 6671 c5fbc05d7347
child 18564 f9db68ff2cbb
permissions -rw-r--r--
7116445: Miscellaneous warnings in the JDBC/RowSet classes Reviewed-by: smarks, chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
6671
c5fbc05d7347 6984044: RowSet source needs to rebrand vendor references
lancea
parents: 5506
diff changeset
     2
 * Copyright (c) 2003, 2010, 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 org.xml.sax.*;
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 implementations of a <code>WebRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * must implement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <h3>1.0 Overview</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * The <code>WebRowSetImpl</code> provides the standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * reference implementation, which may be extended if required.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * The standard WebRowSet XML Schema definition is available at the following
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * URI:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <a href="http://java.sun.com/xml/ns/jdbc/webrowset.xsd">http://java.sun.com/xml/ns/jdbc/webrowset.xsd</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * It describes the standard XML document format required when describing a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <code>RowSet</code> object in XML and must be used be all standard implementations
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * of the <code>WebRowSet</code> interface to ensure interoperability. In addition,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * the <code>WebRowSet</code> schema uses specific SQL/XML Schema annotations,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * thus ensuring greater cross
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * platform inter-operability. This is an effort currently under way at the ISO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * organization. The SQL/XML definition is available at the following URI:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * <a href="http://standards.iso.org/iso/9075/2002/12/sqlxml">http://standards.iso.org/iso/9075/2002/12/sqlxml</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * The schema definition describes the internal data of a <code>RowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * in three distinct areas:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * <UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <li><b>properties</b></li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * These properties describe the standard synchronization provider properties in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * addition to the more general <code>RowSet</code> properties.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * <li><b>metadata</b></li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * This describes the metadata associated with the tabular structure governed by a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * <code>WebRowSet</code> object. The metadata described is closely aligned with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * metadata accessible in the underlying <code>java.sql.ResultSet</code> interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * <li><b>data</b></li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * This describes the original data (the state of data since the last population
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * or last synchronization of the <code>WebRowSet</code> object) and the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * data. By keeping track of the delta between the original data and the current data,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * a <code>WebRowSet</code> maintains
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * the ability to synchronize changes in its data back to the originating data source.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * <h3>2.0 WebRowSet States</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * The following sections demonstrates how a <code>WebRowSet</code> implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * should use the XML Schema to describe update, insert, and delete operations
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * and to describe the state of a <code>WebRowSet</code> object in XML.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * <h4>2.1 State 1 - Outputting a <code>WebRowSet</code> Object to XML</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * In this example, a <code>WebRowSet</code> object is created and populated with a simple 2 column,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * 5 row table from a data source. Having the 5 rows in a <code>WebRowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * makes it possible to describe them in XML. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * metadata describing the various standard JavaBeans properties as defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * in the RowSet interface plus the standard properties defined in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * the <code>CachedRowSet</code><sup><font size=-2>TM</font></sup> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * provide key details that describe WebRowSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * properties. Outputting the WebRowSet object to XML using the standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * <code>writeXml</code> methods describes the internal properties as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * &lt;<font color=red>properties</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 *       &lt;<font color=red>command</font>&gt;select co1, col2 from test_table&lt;<font color=red>/command</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 *      &lt;<font color=red>concurrency</font>&gt;1&lt;<font color=red>/concurrency</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 *      &lt;<font color=red>datasource/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 *      &lt;<font color=red>escape-processing</font>&gt;true&lt;<font color=red>/escape-processing</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 *      &lt;<font color=red>fetch-direction</font>&gt;0&lt;<font color=red>/fetch-direction</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 *      &lt;<font color=red>fetch-size</font>&gt;0&lt;<font color=red>/fetch-size</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 *      &lt;<font color=red>isolation-level</font>&gt;1&lt;<font color=red>/isolation-level</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 *      &lt;<font color=red>key-columns/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 *      &lt;<font color=red>map/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 *      &lt;<font color=red>max-field-size</font>&gt;0&lt;<font color=red>/max-field-size</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 *      &lt;<font color=red>max-rows</font>&gt;0&lt;<font color=red>/max-rows</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 *      &lt;<font color=red>query-timeout</font>&gt;0&lt;<font color=red>/query-timeout</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 *      &lt;<font color=red>read-only</font>&gt;false&lt;<font color=red>/read-only</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 *      &lt;<font color=red>rowset-type</font>&gt;TRANSACTION_READ_UNCOMMITED&lt;<font color=red>/rowset-type</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 *      &lt;<font color=red>show-deleted</font>&gt;false&lt;<font color=red>/show-deleted</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 *      &lt;<font color=red>table-name/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 *      &lt;<font color=red>url</font>&gt;jdbc:thin:oracle&lt;<font color=red>/url</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 *      &lt;<font color=red>sync-provider</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 *              &lt;<font color=red>sync-provider-name</font>&gt;.com.rowset.provider.RIOptimisticProvider&lt;<font color=red>/sync-provider-name</font>&gt;
6671
c5fbc05d7347 6984044: RowSet source needs to rebrand vendor references
lancea
parents: 5506
diff changeset
   118
 *              &lt;<font color=red>sync-provider-vendor</font>&gt;Oracle Corporation&lt;<font color=red>/sync-provider-vendor</font>&gt;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 *              &lt;<font color=red>sync-provider-version</font>&gt;1.0&lt;<font color=red>/sync-provider-name</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 *              &lt;<font color=red>sync-provider-grade</font>&gt;LOW&lt;<font color=red>/sync-provider-grade</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 *              &lt;<font color=red>data-source-lock</font>&gt;NONE&lt;<font color=red>/data-source-lock</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 *      &lt;<font color=red>/sync-provider</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 * &lt;<font color=red>/properties</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 * The meta-data describing the make up of the WebRowSet is described
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 * in XML as detailed below. Note both columns are described between the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 * <code>column-definition</code> tags.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 * &lt;<font color=red>metadata</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 *      &lt;<font color=red>column-count</font>&gt;2&lt;<font color=red>/column-count</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 *      &lt;<font color=red>column-definition</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 *              &lt;<font color=red>column-index</font>&gt;1&lt;<font color=red>/column-index</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 *              &lt;<font color=red>auto-increment</font>&gt;false&lt;<font color=red>/auto-increment</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
 *              &lt;<font color=red>case-sensitive</font>&gt;true&lt;<font color=red>/case-sensitive</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
 *              &lt;<font color=red>currency</font>&gt;false&lt;<font color=red>/currency</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 *              &lt;<font color=red>nullable</font>&gt;1&lt;<font color=red>/nullable</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 *              &lt;<font color=red>signed</font>&gt;false&lt;<font color=red>/signed</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 *              &lt;<font color=red>searchable</font>&gt;true&lt;<font color=red>/searchable</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 *              &lt;<font color=red>column-display-size</font>&gt;10&lt;<font color=red>/column-display-size</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
 *              &lt;<font color=red>column-label</font>&gt;COL1&lt;<font color=red>/column-label</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 *              &lt;<font color=red>column-name</font>&gt;COL1&lt;<font color=red>/column-name</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 *              &lt;<font color=red>schema-name/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 *              &lt;<font color=red>column-precision</font>&gt;10&lt;<font color=red>/column-precision</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 *              &lt;<font color=red>column-scale</font>&gt;0&lt;<font color=red>/column-scale</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 *              &lt;<font color=red>table-name/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 *              &lt;<font color=red>catalog-name/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 *              &lt;<font color=red>column-type</font>&gt;1&lt;<font color=red>/column-type</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 *              &lt;<font color=red>column-type-name</font>&gt;CHAR&lt;<font color=red>/column-type-name</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
 *      &lt;<font color=red>/column-definition</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 *      &lt;<font color=red>column-definition</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 *              &lt;<font color=red>column-index</font>&gt;2&lt;<font color=red>/column-index</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
 *              &lt;<font color=red>auto-increment</font>&gt;false&lt;<font color=red>/auto-increment</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
 *              &lt;<font color=red>case-sensitive</font>&gt;false&lt;<font color=red>/case-sensitive</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
 *              &lt;<font color=red>currency</font>&gt;false&lt;<font color=red>/currency</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
 *              &lt;<font color=red>nullable</font>&gt;1&lt;<font color=red>/nullable</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
 *              &lt;<font color=red>signed</font>&gt;true&lt;<font color=red>/signed</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
 *              &lt;<font color=red>searchable</font>&gt;true&lt;<font color=red>/searchable</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
 *              &lt;<font color=red>column-display-size</font>&gt;39&lt;<font color=red>/column-display-size</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
 *              &lt;<font color=red>column-label</font>&gt;COL2&lt;<font color=red>/column-label</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
 *              &lt;<font color=red>column-name</font>&gt;COL2&lt;<font color=red>/column-name</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
 *              &lt;<font color=red>schema-name/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
 *              &lt;<font color=red>column-precision</font>&gt;38&lt;<font color=red>/column-precision</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
 *              &lt;<font color=red>column-scale</font>&gt;0&lt;<font color=red>/column-scale</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
 *              &lt;<font color=red>table-name/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
 *              &lt;<font color=red>catalog-name/</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
 *              &lt;<font color=red>column-type</font>&gt;3&lt;<font color=red>/column-type</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
 *              &lt;<font color=red>column-type-name</font>&gt;NUMBER&lt;<font color=red>/column-type-name</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
 *      &lt;<font color=red>/column-definition</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
 * &lt;<font color=red>/metadata</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
 * Having detailed how the properties and metadata are described, the following details
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
 * how the contents of a <code>WebRowSet</code> object is described in XML. Note, that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
 * this describes a <code>WebRowSet</code> object that has not undergone any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
 * modifications since its instantiation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
 * A <code>currentRow</code> tag is mapped to each row of the table structure that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
 * <code>WebRowSet</code> object provides. A <code>columnValue</code> tag may contain
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
 * either the <code>stringData</code> or <code>binaryData</code> tag, according to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
 * the SQL type that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
 * the XML value is mapping back to. The <code>binaryData</code> tag contains data in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
 * Base64 encoding and is typically used for <code>BLOB</code> and <code>CLOB</code> type data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
 * &lt;<font color=red>data</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 *                      firstrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
 *                      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
 *                      secondrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
 *                      2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
 *                      thirdrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
 *                      3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
 *                      fourthrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
 *                      4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
 * &lt;<font color=red>/data</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
 * <h4>2.2 State 2 - Deleting a Row</h4>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
 * Deleting a row in a <code>WebRowSet</code> object involves simply moving to the row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
 * to be deleted and then calling the method <code>deleteRow</code>, as in any other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
 * <code>RowSet</code> object.  The following
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
 * two lines of code, in which <i>wrs</i> is a <code>WebRowSet</code> object, delete
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
 * the third row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
 *     wrs.absolute(3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
 *     wrs.deleteRow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
 * The XML description shows the third row is marked as a <code>deleteRow</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
 *  which eliminates the third row in the <code>WebRowSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
 * &lt;<font color=red>data</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
 *                      firstrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
 *                      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
 *                      secondrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
 *                      2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
 *      &lt;<font color=red>deleteRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
 *                      thirdrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
 *                      3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
 *      &lt;<font color=red>/deleteRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
 *                      fourthrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
 *                      4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
 * &lt;<font color=red>/data</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
 * <h4>2.3 State 3 - Inserting a Row</h4>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
 * A <code>WebRowSet</code> object can insert a new row by moving to the insert row,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
 * calling the appropriate updater methods for each column in the row, and then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
 * calling the method <code>insertRow</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
 * wrs.moveToInsertRow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
 * wrs.updateString(1, "fifththrow");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
 * wrs.updateString(2, "5");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
 * wrs.insertRow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
 * The following code fragment changes the second column value in the row just inserted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
 * Note that this code applies when new rows are inserted right after the current row,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
 * which is why the method <code>next</code> moves the cursor to the correct row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
 * Calling the method <code>acceptChanges</code> writes the change to the data source.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
 * wrs.moveToCurrentRow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
 * wrs.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
 * wrs.updateString(2, "V");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
 * wrs.acceptChanges();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
 * :
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
 * Describing this in XML demonstrates where the Java code inserts a new row and then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
 * performs an update on the newly inserted row on an individual field.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
 * &lt;<font color=red>data</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
 *                      firstrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
 *                      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
 *                      secondrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
 *                      2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
 *                      newthirdrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
 *                      III
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
 *      &lt;<font color=red>insertRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
 *                      fifthrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
 *                      5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
 *              &lt;<font color=red>updateValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
 *                      V
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
 *              &lt;<font color=red>/updateValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
 *      &lt;<font color=red>/insertRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
 *                      fourthrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
 *                      4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
 * &lt;<font color=red>/date</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
 * <h4>2.4 State 4 - Modifying a Row</h4>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
 * Modifying a row produces specific XML that records both the new value and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
 * value that was replaced.  The value that was replaced becomes the original value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
 * and the new value becomes the current value. The following
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
 * code moves the cursor to a specific row, performs some modifications, and updates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
 * the row when complete.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
 * wrs.absolute(5);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
 * wrs.updateString(1, "new4thRow");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
 * wrs.updateString(2, "IV");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
 * wrs.updateRow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
 * In XML, this is described by the <code>modifyRow</code> tag. Both the original and new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
 * values are contained within the tag for original row tracking purposes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
 * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
 * &lt;<font color=red>data</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
 *                      firstrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
 *                      1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
 *                      secondrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
 *                      2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
 *                      newthirdrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
 *                      III
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
 *      &lt;<font color=red>currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
 *                      fifthrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
 *                      5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
 *      &lt;<font color=red>/currentRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
 *      &lt;<font color=red>modifyRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
 *                      fourthrow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
 *              &lt;<font color=red>updateValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
 *                      new4thRow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
 *              &lt;<font color=red>/updateValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
 *              &lt;<font color=red>columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
 *                      4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
 *              &lt;<font color=red>/columnValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
 *              &lt;<font color=red>updateValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
 *                      IV
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
 *              &lt;<font color=red>/updateValue</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
 *      &lt;<font color=red>/modifyRow</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
 * &lt;<font color=red>/data</font>&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
 * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
 * @see javax.sql.rowset.JdbcRowSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
 * @see javax.sql.rowset.CachedRowSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
 * @see javax.sql.rowset.FilteredRowSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
 * @see javax.sql.rowset.JoinRowSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
public interface WebRowSet extends CachedRowSet {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    * Reads a <code>WebRowSet</code> object in its XML format from the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
    * <code>Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
    * @param reader the <code>java.io.Reader</code> stream from which this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    *        <code>WebRowSet</code> object will be populated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    * @throws SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    public void readXml(java.io.Reader reader) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * Reads a stream based XML input to populate this <code>WebRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * @param iStream the <code>java.io.InputStream</code> from which this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     *        <code>WebRowSet</code> object will be populated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * @throws SQLException if a data source access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @throws IOException if an IO exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
    public void readXml(java.io.InputStream iStream) throws SQLException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
    * Populates this <code>WebRowSet</code> object with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    * the contents of the given <code>ResultSet</code> object and writes its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
    * data, properties, and metadata
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    * to the given <code>Writer</code> object in XML format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    * NOTE: The <code>WebRowSet</code> cursor may be moved to write out the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    * contents to the XML data source. If implemented in this way, the cursor <b>must</b>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    * be returned to its position just prior to the <code>writeXml()</code> call.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
    * @param rs the <code>ResultSet</code> object with which to populate this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    *        <code>WebRowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    * @param writer the <code>java.io.Writer</code> object to write to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
    * @throws SQLException if an error occurs writing out the rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
    *          contents in XML format
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
    public void writeXml(ResultSet rs, java.io.Writer writer) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    * Populates this <code>WebRowSet</code> object with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
    * the contents of the given <code>ResultSet</code> object and writes its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    * data, properties, and metadata
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    * to the given <code>OutputStream</code> object in XML format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
    * NOTE: The <code>WebRowSet</code> cursor may be moved to write out the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
    * contents to the XML data source. If implemented in this way, the cursor <b>must</b>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    * be returned to its position just prior to the <code>writeXml()</code> call.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
    * @param rs the <code>ResultSet</code> object with which to populate this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    *        <code>WebRowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
    * @param oStream the <code>java.io.OutputStream</code> to write to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
    * @throws SQLException if a data source access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
    * @throws IOException if a IO exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
    public void writeXml(ResultSet rs, java.io.OutputStream oStream) throws SQLException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
    * Writes the data, properties, and metadata for this <code>WebRowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
    * to the given <code>Writer</code> object in XML format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
    * @param writer the <code>java.io.Writer</code> stream to write to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
    * @throws SQLException if an error occurs writing out the rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
    *          contents to XML
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
    public void writeXml(java.io.Writer writer) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * Writes the data, properties, and metadata for this <code>WebRowSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * to the given <code>OutputStream</code> object in XML format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * @param oStream the <code>java.io.OutputStream</code> stream to write to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * @throws SQLException if a data source access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * @throws IOException if a IO exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
    public void writeXml(java.io.OutputStream oStream) throws SQLException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * The public identifier for the XML Schema definition that defines the XML
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * tags and their valid values for a <code>WebRowSet</code> implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
    public static String PUBLIC_XML_SCHEMA =
6671
c5fbc05d7347 6984044: RowSet source needs to rebrand vendor references
lancea
parents: 5506
diff changeset
   492
        "--//Oracle Corporation//XSD Schema//EN";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * The URL for the XML Schema definition file that defines the XML tags and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * their valid values for a <code>WebRowSet</code> implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
    public static String SCHEMA_SYSTEM_ID = "http://java.sun.com/xml/ns/jdbc/webrowset.xsd";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
}