Source Code Cross Referenced for WebRowSet.java in  » 6.0-JDK-Core » sql » javax » sql » rowset » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » sql » javax.sql.rowset 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package javax.sql.rowset;
027
028        import java.sql.*;
029        import javax.sql.*;
030        import javax.naming.*;
031        import java.io.*;
032        import java.math.*;
033        import org.xml.sax.*;
034
035        /**
036         * The standard interface that all implementations of a <code>WebRowSet</code>
037         * must implement. 
038         * <P>
039         * <h3>1.0 Overview</h3>
040         * The <code>WebRowSetImpl</code> provides the standard 
041         * reference implementation, which may be extended if required. 
042         * <P>
043         * The standard WebRowSet XML Schema definition is available at the following
044         * URI:
045         * <ul>
046         * <pre>
047         * <a href="http://java.sun.com/xml/ns/jdbc/webrowset.xsd">http://java.sun.com/xml/ns/jdbc/webrowset.xsd</a>
048         * </pre>
049         * </ul>
050         * It describes the standard XML document format required when describing a
051         * <code>RowSet</code> object in XML and must be used be all standard implementations 
052         * of the <code>WebRowSet</code> interface to ensure interoperability. In addition, 
053         * the <code>WebRowSet</code> schema uses specific SQL/XML Schema annotations,
054         * thus ensuring greater cross 
055         * platform inter-operability. This is an effort currently under way at the ISO
056         * organization. The SQL/XML definition is available at the following URI:
057         * <ul>
058         * <pre>
059         * <a href="http://standards.iso.org/iso/9075/2002/12/sqlxml">http://standards.iso.org/iso/9075/2002/12/sqlxml</a>
060         * </pre>
061         * </ul>
062         * The schema definition describes the internal data of a <code>RowSet</code> object
063         * in three distinct areas:
064         * <UL>
065         * <li><b>properties</b></li>
066         * These properties describe the standard synchronization provider properties in
067         * addition to the more general <code>RowSet</code> properties.
068         * <p>
069         * <li><b>metadata</b></li>
070         * This describes the metadata associated with the tabular structure governed by a
071         * <code>WebRowSet</code> object. The metadata described is closely aligned with the
072         * metadata accessible in the underlying <code>java.sql.ResultSet</code> interface.
073         * <p>
074         * <li><b>data</b></li>
075         * This describes the original data (the state of data since the last population 
076         * or last synchronization of the <code>WebRowSet</code> object) and the current 
077         * data. By keeping track of the delta between the original data and the current data, 
078         * a <code>WebRowSet</code> maintains
079         * the ability to synchronize changes in its data back to the originating data source.
080         * </ul>
081         * <P>
082         * <h3>2.0 WebRowSet States</h3>
083         * The following sections demonstrates how a <code>WebRowSet</code> implementation
084         * should use the XML Schema to describe update, insert, and delete operations 
085         * and to describe the state of a <code>WebRowSet</code> object in XML. 
086         * <p>
087         * <h4>2.1 State 1 - Outputting a <code>WebRowSet</code> Object to XML</h3>
088         * In this example, a <code>WebRowSet</code> object is created and populated with a simple 2 column, 
089         * 5 row table from a data source. Having the 5 rows in a <code>WebRowSet</code> object
090         * makes it possible to describe them in XML. The
091         * metadata describing the various standard JavaBeans properties as defined
092         * in the RowSet interface plus the standard properties defined in
093         * the <code>CachedRowSet</code><sup><font size=-2>TM</font></sup> interface 
094         * provide key details that describe WebRowSet
095         * properties. Outputting the WebRowSet object to XML using the standard 
096         * <code>writeXml</code> methods describes the internal properties as follows:
097         * <PRE>
098         * &lt;<font color=red>properties</font>&gt;
099         *       &lt;<font color=red>command</font>&gt;select co1, col2 from test_table&lt;<font color=red>/command</font>&gt;
100         *	&lt;<font color=red>concurrency</font>&gt;1&lt;<font color=red>/concurrency</font>&gt;
101         *	&lt;<font color=red>datasource/</font>&gt;
102         *	&lt;<font color=red>escape-processing</font>&gt;true&lt;<font color=red>/escape-processing</font>&gt;
103         *	&lt;<font color=red>fetch-direction</font>&gt;0&lt;<font color=red>/fetch-direction</font>&gt;
104         *	&lt;<font color=red>fetch-size</font>&gt;0&lt;<font color=red>/fetch-size</font>&gt;
105         *	&lt;<font color=red>isolation-level</font>&gt;1&lt;<font color=red>/isolation-level</font>&gt;
106         *	&lt;<font color=red>key-columns/</font>&gt;
107         *	&lt;<font color=red>map/</font>&gt;
108         *	&lt;<font color=red>max-field-size</font>&gt;0&lt;<font color=red>/max-field-size</font>&gt;
109         *	&lt;<font color=red>max-rows</font>&gt;0&lt;<font color=red>/max-rows</font>&gt;
110         *	&lt;<font color=red>query-timeout</font>&gt;0&lt;<font color=red>/query-timeout</font>&gt;
111         *	&lt;<font color=red>read-only</font>&gt;false&lt;<font color=red>/read-only</font>&gt;
112         *	&lt;<font color=red>rowset-type</font>&gt;TRANSACTION_READ_UNCOMMITED&lt;<font color=red>/rowset-type</font>&gt;
113         *	&lt;<font color=red>show-deleted</font>&gt;false&lt;<font color=red>/show-deleted</font>&gt;
114         *	&lt;<font color=red>table-name/</font>&gt;
115         *	&lt;<font color=red>url</font>&gt;jdbc:thin:oracle&lt;<font color=red>/url</font>&gt;
116         *	&lt;<font color=red>sync-provider</font>&gt;
117         *		&lt;<font color=red>sync-provider-name</font>&gt;.com.rowset.provider.RIOptimisticProvider&lt;<font color=red>/sync-provider-name</font>&gt;
118         *		&lt;<font color=red>sync-provider-vendor</font>&gt;Sun Microsystems&lt;<font color=red>/sync-provider-vendor</font>&gt;
119         *		&lt;<font color=red>sync-provider-version</font>&gt;1.0&lt;<font color=red>/sync-provider-name</font>&gt;
120         *		&lt;<font color=red>sync-provider-grade</font>&gt;LOW&lt;<font color=red>/sync-provider-grade</font>&gt;
121         *              &lt;<font color=red>data-source-lock</font>&gt;NONE&lt;<font color=red>/data-source-lock</font>&gt;
122         *	&lt;<font color=red>/sync-provider</font>&gt;
123         * &lt;<font color=red>/properties</font>&gt; 
124         * </PRE>
125         * The meta-data describing the make up of the WebRowSet is described 
126         * in XML as detailed below. Note both columns are described between the 
127         * <code>column-definition</code> tags.
128         * <PRE>
129         * &lt;<font color=red>metadata</font>&gt;
130         *	&lt;<font color=red>column-count</font>&gt;2&lt;<font color=red>/column-count</font>&gt;
131         *	&lt;<font color=red>column-definition</font>&gt;
132         *		&lt;<font color=red>column-index</font>&gt;1&lt;<font color=red>/column-index</font>&gt;
133         *		&lt;<font color=red>auto-increment</font>&gt;false&lt;<font color=red>/auto-increment</font>&gt;
134         *		&lt;<font color=red>case-sensitive</font>&gt;true&lt;<font color=red>/case-sensitive</font>&gt;
135         *		&lt;<font color=red>currency</font>&gt;false&lt;<font color=red>/currency</font>&gt;
136         *		&lt;<font color=red>nullable</font>&gt;1&lt;<font color=red>/nullable</font>&gt;
137         *		&lt;<font color=red>signed</font>&gt;false&lt;<font color=red>/signed</font>&gt;
138         *		&lt;<font color=red>searchable</font>&gt;true&lt;<font color=red>/searchable</font>&gt;
139         *		&lt;<font color=red>column-display-size</font>&gt;10&lt;<font color=red>/column-display-size</font>&gt;   
140         *		&lt;<font color=red>column-label</font>&gt;COL1&lt;<font color=red>/column-label</font>&gt;
141         *		&lt;<font color=red>column-name</font>&gt;COL1&lt;<font color=red>/column-name</font>&gt;
142         *		&lt;<font color=red>schema-name/</font>&gt;
143         *		&lt;<font color=red>column-precision</font>&gt;10&lt;<font color=red>/column-precision</font>&gt;
144         *		&lt;<font color=red>column-scale</font>&gt;0&lt;<font color=red>/column-scale</font>&gt;
145         *		&lt;<font color=red>table-name/</font>&gt;
146         *		&lt;<font color=red>catalog-name/</font>&gt;
147         *		&lt;<font color=red>column-type</font>&gt;1&lt;<font color=red>/column-type</font>&gt;
148         *		&lt;<font color=red>column-type-name</font>&gt;CHAR&lt;<font color=red>/column-type-name</font>&gt;
149         *	&lt;<font color=red>/column-definition</font>&gt;
150         *	&lt;<font color=red>column-definition</font>&gt;
151         *		&lt;<font color=red>column-index</font>&gt;2&lt;<font color=red>/column-index</font>&gt;
152         *		&lt;<font color=red>auto-increment</font>&gt;false&lt;<font color=red>/auto-increment</font>&gt;
153         *		&lt;<font color=red>case-sensitive</font>&gt;false&lt;<font color=red>/case-sensitive</font>&gt;
154         *		&lt;<font color=red>currency</font>&gt;false&lt;<font color=red>/currency</font>&gt;
155         *		&lt;<font color=red>nullable</font>&gt;1&lt;<font color=red>/nullable</font>&gt;
156         *		&lt;<font color=red>signed</font>&gt;true&lt;<font color=red>/signed</font>&gt;
157         *		&lt;<font color=red>searchable</font>&gt;true&lt;<font color=red>/searchable</font>&gt;
158         *		&lt;<font color=red>column-display-size</font>&gt;39&lt;<font color=red>/column-display-size</font>&gt;
159         *		&lt;<font color=red>column-label</font>&gt;COL2&lt;<font color=red>/column-label</font>&gt;
160         *		&lt;<font color=red>column-name</font>&gt;COL2&lt;<font color=red>/column-name</font>&gt;
161         *		&lt;<font color=red>schema-name/</font>&gt;
162         *		&lt;<font color=red>column-precision</font>&gt;38&lt;<font color=red>/column-precision</font>&gt;
163         *		&lt;<font color=red>column-scale</font>&gt;0&lt;<font color=red>/column-scale</font>&gt;
164         *		&lt;<font color=red>table-name/</font>&gt;
165         *		&lt;<font color=red>catalog-name/</font>&gt;
166         *		&lt;<font color=red>column-type</font>&gt;3&lt;<font color=red>/column-type</font>&gt;
167         *		&lt;<font color=red>column-type-name</font>&gt;NUMBER&lt;<font color=red>/column-type-name</font>&gt;
168         *	&lt;<font color=red>/column-definition</font>&gt;
169         * &lt;<font color=red>/metadata</font>&gt;
170         * </PRE>
171         * Having detailed how the properties and metadata are described, the following details
172         * how the contents of a <code>WebRowSet</code> object is described in XML. Note, that
173         * this describes a <code>WebRowSet</code> object that has not undergone any 
174         * modifications since its instantiation.
175         * A <code>currentRow</code> tag is mapped to each row of the table structure that the
176         * <code>WebRowSet</code> object provides. A <code>columnValue</code> tag may contain
177         * either the <code>stringData</code> or <code>binaryData</code> tag, according to 
178         * the SQL type that
179         * the XML value is mapping back to. The <code>binaryData</code> tag contains data in the
180         * Base64 encoding and is typically used for <code>BLOB</code> and <code>CLOB</code> type data.
181         * <PRE>
182         * &lt;<font color=red>data</font>&gt;
183         *	&lt;<font color=red>currentRow</font>&gt;
184         *		&lt;<font color=red>columnValue</font>&gt;
185         *			firstrow
186         *		&lt;<font color=red>/columnValue</font>&gt;
187         *		&lt;<font color=red>columnValue</font>&gt;
188         *			1
189         *		&lt;<font color=red>/columnValue</font>&gt;
190         *	&lt;<font color=red>/currentRow</font>&gt;
191         *	&lt;<font color=red>currentRow</font>&gt;
192         *		&lt;<font color=red>columnValue</font>&gt;
193         *			secondrow
194         *		&lt;<font color=red>/columnValue</font>&gt;
195         *		&lt;<font color=red>columnValue</font>&gt;
196         *			2
197         *		&lt;<font color=red>/columnValue</font>&gt;
198         *	&lt;<font color=red>/currentRow</font>&gt;
199         *	&lt;<font color=red>currentRow</font>&gt;
200         *		&lt;<font color=red>columnValue</font>&gt;
201         *			thirdrow
202         *		&lt;<font color=red>/columnValue</font>&gt;
203         *		&lt;<font color=red>columnValue</font>&gt;
204         *			3
205         *		&lt;<font color=red>/columnValue</font>&gt;
206         *	&lt;<font color=red>/currentRow</font>&gt;
207         *	&lt;<font color=red>currentRow</font>&gt;
208         *		&lt;<font color=red>columnValue</font>&gt;
209         *			fourthrow
210         *		&lt;<font color=red>/columnValue</font>&gt;
211         *		&lt;<font color=red>columnValue</font>&gt;
212         *			4
213         *		&lt;<font color=red>/columnValue</font>&gt;
214         *	&lt;<font color=red>/currentRow</font>&gt;
215         * &lt;<font color=red>/data</font>&gt;
216         * </PRE>
217         * <h4>2.2 State 2 - Deleting a Row</h4>
218         * Deleting a row in a <code>WebRowSet</code> object involves simply moving to the row
219         * to be deleted and then calling the method <code>deleteRow</code>, as in any other
220         * <code>RowSet</code> object.  The following
221         * two lines of code, in which <i>wrs</i> is a <code>WebRowSet</code> object, delete 
222         * the third row.
223         * <PRE>
224         *     wrs.absolute(3);
225         *     wrs.deleteRow();
226         * </PRE>
227         * The XML description shows the third row is marked as a <code>deleteRow</code>,
228         *  which eliminates the third row in the <code>WebRowSet</code> object.
229         * <PRE>
230         * &lt;<font color=red>data</font>&gt;
231         *	&lt;<font color=red>currentRow</font>&gt;
232         *		&lt;<font color=red>columnValue</font>&gt;
233         *			firstrow
234         *		&lt;<font color=red>/columnValue</font>&gt;
235         *		&lt;<font color=red>columnValue</font>&gt;
236         *			1
237         *		&lt;<font color=red>/columnValue</font>&gt;
238         *	&lt;<font color=red>/currentRow</font>&gt;
239         *	&lt;<font color=red>currentRow</font>&gt;
240         *		&lt;<font color=red>columnValue</font>&gt;
241         *			secondrow
242         *		&lt;<font color=red>/columnValue</font>&gt;
243         *		&lt;<font color=red>columnValue</font>&gt;
244         *			2
245         *		&lt;<font color=red>/columnValue</font>&gt;
246         *	&lt;<font color=red>/currentRow</font>&gt;
247         *	&lt;<font color=red>deleteRow</font>&gt;
248         *		&lt;<font color=red>columnValue</font>&gt;
249         *			thirdrow
250         *		&lt;<font color=red>/columnValue</font>&gt;
251         *		&lt;<font color=red>columnValue</font>&gt;
252         *			3
253         *		&lt;<font color=red>/columnValue</font>&gt;
254         *	&lt;<font color=red>/deleteRow</font>&gt;
255         *	&lt;<font color=red>currentRow</font>&gt;
256         *		&lt;<font color=red>columnValue</font>&gt;
257         *			fourthrow
258         *		&lt;<font color=red>/columnValue</font>&gt;
259         *		&lt;<font color=red>columnValue</font>&gt;
260         *			4
261         *		&lt;<font color=red>/columnValue</font>&gt;
262         *	&lt;<font color=red>/currentRow</font>&gt;
263         * &lt;<font color=red>/data</font>&gt;
264         * </PRE>
265         * <h4>2.3 State 3 - Inserting a Row</h4>
266         * A <code>WebRowSet</code> object can insert a new row by moving to the insert row,
267         * calling the appropriate updater methods for each column in the row, and then
268         * calling the method <code>insertRow</code>.
269         * <PRE>
270         * wrs.moveToInsertRow();
271         * wrs.updateString(1, "fifththrow");
272         * wrs.updateString(2, "5");
273         * wrs.insertRow();
274         * </PRE>
275         * The following code fragment changes the second column value in the row just inserted.
276         * Note that this code applies when new rows are inserted right after the current row,
277         * which is why the method <code>next</code> moves the cursor to the correct row.
278         * Calling the method <code>acceptChanges</code> writes the change to the data source.  
279         * 
280         * <PRE>
281         * wrs.moveToCurrentRow();
282         * wrs.next();
283         * wrs.updateString(2, "V");
284         * wrs.acceptChanges();
285         * :
286         * </PRE>
287         * Describing this in XML demonstrates where the Java code inserts a new row and then
288         * performs an update on the newly inserted row on an individual field.
289         * <PRE> 
290         * &lt;<font color=red>data</font>&gt;
291         *	&lt;<font color=red>currentRow</font>&gt;
292         *		&lt;<font color=red>columnValue</font>&gt;
293         *			firstrow
294         *		&lt;<font color=red>/columnValue</font>&gt;
295         *		&lt;<font color=red>columnValue</font>&gt;
296         *			1
297         *		&lt;<font color=red>/columnValue</font>&gt;
298         *	&lt;<font color=red>/currentRow</font>&gt;
299         *	&lt;<font color=red>currentRow</font>&gt;
300         *		&lt;<font color=red>columnValue</font>&gt;
301         *			secondrow
302         *		&lt;<font color=red>/columnValue</font>&gt;
303         *		&lt;<font color=red>columnValue</font>&gt;
304         *			2
305         *		&lt;<font color=red>/columnValue</font>&gt;
306         *	&lt;<font color=red>/currentRow</font>&gt;
307         *	&lt;<font color=red>currentRow</font>&gt;
308         *		&lt;<font color=red>columnValue</font>&gt;
309         *			newthirdrow
310         *		&lt;<font color=red>/columnValue</font>&gt;
311         *		&lt;<font color=red>columnValue</font>&gt;
312         *			III
313         *		&lt;<font color=red>/columnValue</font>&gt;
314         *	&lt;<font color=red>/currentRow</font>&gt;
315         *	&lt;<font color=red>insertRow</font>&gt;
316         *		&lt;<font color=red>columnValue</font>&gt;
317         *			fifthrow
318         *		&lt;<font color=red>/columnValue</font>&gt;
319         *		&lt;<font color=red>columnValue</font>&gt;
320         *			5
321         *		&lt;<font color=red>/columnValue</font>&gt;
322         *		&lt;<font color=red>updateValue</font>&gt;
323         *			V
324         *		&lt;<font color=red>/updateValue</font>&gt;
325         *	&lt;<font color=red>/insertRow</font>&gt;
326         *	&lt;<font color=red>currentRow</font>&gt;
327         *		&lt;<font color=red>columnValue</font>&gt;
328         *			fourthrow
329         *		&lt;<font color=red>/columnValue</font>&gt;
330         *		&lt;<font color=red>columnValue</font>&gt;
331         *			4
332         *		&lt;<font color=red>/columnValue</font>&gt;
333         *	&lt;<font color=red>/currentRow</font>&gt;
334         * &lt;<font color=red>/date</font>&gt;
335         * </PRE>
336         * <h4>2.4 State 4 - Modifying a Row</h4>
337         * Modifying a row produces specific XML that records both the new value and the 
338         * value that was replaced.  The value that was replaced becomes the original value,
339         * and the new value becomes the current value. The following
340         * code moves the cursor to a specific row, performs some modifications, and updates
341         * the row when complete.
342         * <PRE>
343         * wrs.absolute(5);
344         * wrs.updateString(1, "new4thRow");
345         * wrs.updateString(2, "IV");
346         * wrs.updateRow();
347         * </PRE>
348         * In XML, this is described by the <code>modifyRow</code> tag. Both the original and new
349         * values are contained within the tag for original row tracking purposes.
350         * <PRE>
351         * &lt;<font color=red>data</font>&gt;
352         *	&lt;<font color=red>currentRow</font>&gt;
353         *		&lt;<font color=red>columnValue</font>&gt;
354         *			firstrow
355         *		&lt;<font color=red>/columnValue</font>&gt;
356         *		&lt;<font color=red>columnValue</font>&gt;
357         *			1
358         *		&lt;<font color=red>/columnValue</font>&gt;
359         *	&lt;<font color=red>/currentRow</font>&gt;
360         *	&lt;<font color=red>currentRow</font>&gt;
361         *		&lt;<font color=red>columnValue</font>&gt;
362         *			secondrow
363         *		&lt;<font color=red>/columnValue</font>&gt;
364         *		&lt;<font color=red>columnValue</font>&gt;
365         *			2
366         *		&lt;<font color=red>/columnValue</font>&gt;
367         *	&lt;<font color=red>/currentRow</font>&gt;
368         *	&lt;<font color=red>currentRow</font>&gt;
369         *		&lt;<font color=red>columnValue</font>&gt;
370         *			newthirdrow
371         *		&lt;<font color=red>/columnValue</font>&gt;
372         *		&lt;<font color=red>columnValue</font>&gt;
373         *			III
374         *		&lt;<font color=red>/columnValue</font>&gt;
375         *	&lt;<font color=red>/currentRow</font>&gt;
376         *	&lt;<font color=red>currentRow</font>&gt;
377         *		&lt;<font color=red>columnValue</font>&gt;
378         *			fifthrow
379         *		&lt;<font color=red>/columnValue</font>&gt;
380         *		&lt;<font color=red>columnValue</font>&gt;
381         *			5
382         *		&lt;<font color=red>/columnValue</font>&gt;
383         *	&lt;<font color=red>/currentRow</font>&gt;
384         *	&lt;<font color=red>modifyRow</font>&gt;
385         *		&lt;<font color=red>columnValue</font>&gt;
386         *			fourthrow
387         *		&lt;<font color=red>/columnValue</font>&gt;
388         *		&lt;<font color=red>updateValue</font>&gt;
389         *			new4thRow
390         *		&lt;<font color=red>/updateValue</font>&gt;
391         *		&lt;<font color=red>columnValue</font>&gt;
392         *			4
393         *		&lt;<font color=red>/columnValue</font>&gt;
394         *		&lt;<font color=red>updateValue</font>&gt;
395         *			IV
396         *		&lt;<font color=red>/updateValue</font>&gt;
397         *	&lt;<font color=red>/modifyRow</font>&gt;
398         * &lt;<font color=red>/data</font>&gt;
399         * </PRE>
400         *
401         * @see javax.sql.rowset.JdbcRowSet
402         * @see javax.sql.rowset.CachedRowSet
403         * @see javax.sql.rowset.FilteredRowSet
404         * @see javax.sql.rowset.JoinRowSet
405         */
406
407        public interface WebRowSet extends CachedRowSet {
408
409            /**
410             * Reads a <code>WebRowSet</code> object in its XML format from the given 
411             * <code>Reader</code> object.
412             * 
413             * @param reader the <code>java.io.Reader</code> stream from which this
414             *        <code>WebRowSet</code> object will be populated
415
416             * @throws SQLException if a database access error occurs    
417             */
418            public void readXml(java.io.Reader reader) throws SQLException;
419
420            /**
421             * Reads a stream based XML input to populate this <code>WebRowSet</code>
422             * object.
423             *
424             * @param iStream the <code>java.io.InputStream</code> from which this
425             *        <code>WebRowSet</code> object will be populated
426             * @throws SQLException if a data source access error occurs
427             * @throws IOException if an IO exception occurs
428             */
429            public void readXml(java.io.InputStream iStream)
430                    throws SQLException, IOException;
431
432            /**
433             * Populates this <code>WebRowSet</code> object with
434             * the contents of the given <code>ResultSet</code> object and writes its
435             * data, properties, and metadata
436             * to the given <code>Writer</code> object in XML format.
437             * <p>
438             * NOTE: The <code>WebRowSet</code> cursor may be moved to write out the
439             * contents to the XML data source. If implemented in this way, the cursor <b>must</b>
440             * be returned to its position just prior to the <code>writeXml()</code> call.
441             *
442             * @param rs the <code>ResultSet</code> object with which to populate this
443             *        <code>WebRowSet</code> object
444             * @param writer the <code>java.io.Writer</code> object to write to.
445             * @throws SQLException if an error occurs writing out the rowset
446             *          contents in XML format
447             */
448            public void writeXml(ResultSet rs, java.io.Writer writer)
449                    throws SQLException;
450
451            /**
452             * Populates this <code>WebRowSet</code> object with
453             * the contents of the given <code>ResultSet</code> object and writes its
454             * data, properties, and metadata
455             * to the given <code>OutputStream</code> object in XML format.
456             * <p>
457             * NOTE: The <code>WebRowSet</code> cursor may be moved to write out the
458             * contents to the XML data source. If implemented in this way, the cursor <b>must</b>
459             * be returned to its position just prior to the <code>writeXml()</code> call.     
460             *
461             * @param rs the <code>ResultSet</code> object with which to populate this
462             *        <code>WebRowSet</code> object
463             * @param oStream the <code>java.io.OutputStream</code> to write to
464             * @throws SQLException if a data source access error occurs
465             * @throws IOException if a IO exception occurs
466             */
467            public void writeXml(ResultSet rs, java.io.OutputStream oStream)
468                    throws SQLException, IOException;
469
470            /**
471             * Writes the data, properties, and metadata for this <code>WebRowSet</code> object 
472             * to the given <code>Writer</code> object in XML format.
473             *
474             * @param writer the <code>java.io.Writer</code> stream to write to
475             * @throws SQLException if an error occurs writing out the rowset
476             *          contents to XML
477             */
478            public void writeXml(java.io.Writer writer) throws SQLException;
479
480            /**
481             * Writes the data, properties, and metadata for this <code>WebRowSet</code> object 
482             * to the given <code>OutputStream</code> object in XML format.
483             *
484             * @param oStream the <code>java.io.OutputStream</code> stream to write to
485             * @throws SQLException if a data source access error occurs
486             * @throws IOException if a IO exception occurs
487             */
488            public void writeXml(java.io.OutputStream oStream)
489                    throws SQLException, IOException;
490
491            /**
492             * The public identifier for the XML Schema definition that defines the XML
493             * tags and their valid values for a <code>WebRowSet</code> implementation.
494             */
495            public static String PUBLIC_XML_SCHEMA = "--//Sun Microsystems, Inc.//XSD Schema//EN";
496
497            /**
498             * The URL for the XML Schema definition file that defines the XML tags and
499             * their valid values for a <code>WebRowSet</code> implementation.
500             */
501            public static String SCHEMA_SYSTEM_ID = "http://java.sun.com/xml/ns/jdbc/webrowset.xsd";
502        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.