Source Code Cross Referenced for JoinRowSet.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-2004 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 java.util.*;
034
035        import javax.sql.rowset.*;
036
037        /**
038         * The <code>JoinRowSet</code> interface provides a mechanism for combining related
039         * data from different <code>RowSet</code> objects into one <code>JoinRowSet</code>
040         * object, which represents an SQL <code>JOIN</code>.
041         * In other words, a <code>JoinRowSet</code> object acts as a
042         * container for the data from <code>RowSet</code> objects that form an SQL
043         * <code>JOIN</code> relationship.
044         * <P>
045         * The <code>Joinable</code> interface provides the methods for setting,
046         * retrieving, and unsetting a match column, the basis for 
047         * establishing an SQL <code>JOIN</code> relationship. The match column may
048         * alternatively be set by supplying it to the appropriate version of the
049         * <code>JointRowSet</code> method <code>addRowSet</code>.
050         * <P>
051         * <p>
052         * <h3>1.0 Overview</h3>
053         * Disconnected <code>RowSet</code> objects (<code>CachedRowSet</code> objects
054         * and implementations extending the <code>CachedRowSet</code> interface)
055         * do not have a standard way to establish an SQL <code>JOIN</code> between 
056         * <code>RowSet</code> objects without the expensive operation of 
057         * reconnecting to the data source. The <code>JoinRowSet</code> 
058         * interface is specifically designed to address this need. 
059         * <P>
060         * Any <code>RowSet</code> object 
061         * can be added to a <code>JoinRowSet</code> object to become
062         * part of an SQL <code>JOIN</code> relationship. This means that both connected
063         * and disconnected <code>RowSet</code> objects can be part of a <code>JOIN</code>.
064         * <code>RowSet</code> objects operating in a connected environment 
065         * (<code>JdbcRowSet</code> objects) are
066         * encouraged to use the database to which they are already 
067         * connected to establish SQL <code>JOIN</code> relationships between
068         * tables directly. However, it is possible for a
069         * <code>JdbcRowSet</code> object to be added to a <code>JoinRowSet</code> object 
070         * if necessary.  
071         * <P>
072         * Any number of <code>RowSet</code> objects can be added to an
073         * instance of <code>JoinRowSet</code> provided that they
074         * can be related in an SQL <code>JOIN</code>.
075         * By definition, the SQL <code>JOIN</code> statement is used to
076         * combine the data contained in two or more relational database tables based
077         * upon a common attribute. The <code>Joinable</code> interface provides the methods
078         * for establishing a common attribute, which is done by setting a
079         * <i>match column</i>. The match column commonly coincides with
080         * the primary key, but there is
081         * no requirement that the match column be the same as the primary key.
082         * By establishing and then enforcing column matches,
083         * a <code>JoinRowSet</code> object establishes <code>JOIN</code> relationships 
084         * between <code>RowSet</code> objects without the assistance of an available
085         * relational database.
086         * <P>
087         * The type of <code>JOIN</code> to be established is determined by setting
088         * one of the <code>JoinRowSet</code> constants using the method
089         * <code>setJoinType</code>. The following SQL <code>JOIN</code> types can be set:
090         * <UL>
091         *  <LI><code>CROSS_JOIN</code>
092         *  <LI><code>FULL_JOIN</code>
093         *  <LI><code>INNER_JOIN</code> - the default if no <code>JOIN</code> type has been set
094         *  <LI><code>LEFT_OUTER_JOIN</code>
095         *  <LI><code>RIGHT_OUTER_JOIN</code>
096         * </UL>
097         * Note that if no type is set, the <code>JOIN</code> will automatically be an
098         * inner join. The comments for the fields in the
099         * <code>JoinRowSet</code> interface explain these <code>JOIN</code> types, which are
100         * standard SQL <code>JOIN</code> types. 
101         * <P>
102         * <h3>2.0 Using a <code>JoinRowSet</code> Object for Creating a <code>JOIN</code></h3>
103         * When a <code>JoinRowSet</code> object is created, it is empty.
104         * The first <code>RowSet</code> object to be added becomes the basis for the
105         * <code>JOIN</code> relationship.
106         * Applications must determine which column in each of the
107         * <code>RowSet</code> objects to be added to the <code>JoinRowSet</code> object 
108         * should be the match column. All of the 
109         * <code>RowSet</code> objects must contain a match column, and the values in
110         * each match column must be ones that can be compared to values in the other match
111         * columns. The columns do not have to have the same name, though they often do, 
112         * and they do not have to store the exact same data type as long as the data types
113         * can be compared.  
114         * <P>
115         * A match column can be be set in two ways: 
116         * <ul>
117         *  <li>By calling the <code>Joinable</code> method <code>setMatchColumn</code><br>
118         *  This is the only method that can set the match column before a <code>RowSet</code> 
119         *  object is added to a <code>JoinRowSet</code> object. The <code>RowSet</code> object
120         *  must have implemented the <code>Joinable</code> interface in order to use the method
121         *  <code>setMatchColumn</code>. Once the match column value
122         *  has been set, this method can be used to reset the match column at any time.
123         *  <li>By calling one of the versions of the <code>JoinRowSet</code> method 
124         *  <code>addRowSet</code> that takes a column name or number (or an array of
125         *  column names or numbers)<BR>
126         *  Four of the five <code>addRowSet</code> methods take a match column as a parameter.
127         *  These four methods set or reset the match column at the time a <code>RowSet</code> 
128         *  object is being added to a <code>JoinRowSet</code> object.
129         * </ul>
130         * <h3>3.0 Sample Usage</h3>
131         * <p>
132         * The following code fragment adds two <code>CachedRowSet</code> 
133         * objects to a <code>JoinRowSet</code> object. Note that in this example,
134         * no SQL <code>JOIN</code> type is set, so the default <code>JOIN</code> type,
135         * which is <i>INNER_JOIN</i>, is established. 
136         * <p>
137         * In the following code fragment, the table <code>EMPLOYEES</code>, whose match 
138         * column is set to the first column (<code>EMP_ID</code>), is added to the
139         * <code>JoinRowSet</code> object <i>jrs</i>. Then
140         * the table <code>ESSP_BONUS_PLAN</code>, whose match column is likewise 
141         * the <code>EMP_ID</code> column, is added. When this second
142         * table is added to <i>jrs</i>, only the rows in 
143         * <code>ESSP_BONUS_PLAN</code> whose <code>EMP_ID</code> value matches an
144         * <code>EMP_ID</code> value in the <code>EMPLOYEES</code> table are added.
145         * In this case, everyone in the bonus plan is an employee, so all of the rows
146         * in the table <code>ESSP_BONUS_PLAN</code> are added to the <code>JoinRowSet</code>
147         * object.  In this example, both <code>CachedRowSet</code> objects being added
148         * have implemented the <code>Joinable</code> interface and can therefore call 
149         * the <code>Joinable</code> method <code>setMatchColumn</code>.
150         * <PRE>
151         *     JoinRowSet jrs = new JoinRowSetImpl();
152         * 
153         *     ResultSet rs1 = stmt.executeQuery("SELECT * FROM EMPLOYEES");
154         *     CachedRowSet empl = new CachedRowSetImpl();
155         *     empl.populate(rs1);
156         *     empl.setMatchColumn(1); 
157         *     jrs.addRowSet(empl);
158         * 
159         *     ResultSet rs2 = stmt.executeQuery("SELECT * FROM ESSP_BONUS_PLAN");
160         *     CachedRowSet bonus = new CachedRowSetImpl();
161         *     bonus.populate(rs2);
162         *     bonus.setMatchColumn(1); // EMP_ID is the first column
163         *     jrs.addRowSet(bonus);
164         * </PRE>
165         * <P>
166         * At this point, <i>jrs</i> is an inside JOIN of the two <code>RowSet</code> objects
167         * based on their <code>EMP_ID</code> columns. The application can now browse the
168         * combined data as if it were browsing one single <code>RowSet</code> object.
169         * Because <i>jrs</i> is itself a <code>RowSet</code> object, an application can
170         * navigate or modify it using <code>RowSet</code> methods.
171         * <PRE>
172         *     jrs.first();
173         *     int employeeID = jrs.getInt(1);
174         *     String employeeName = jrs.getString(2);
175         * </PRE>
176         * <P>
177         * Note that because the SQL <code>JOIN</code> must be enforced when an application
178         * adds a second or subsequent <code>RowSet</code> object, there
179         * may be an initial degradation in performance while the <code>JOIN</code> is
180         * being performed.
181         * <P>
182         * The following code fragment adds an additional <code>CachedRowSet</code> object.
183         * In this case, the match column (<code>EMP_ID</code>) is set when the 
184         * <code>CachedRowSet</code> object is added to the <code>JoinRowSet</code> object. 
185         * <PRE>
186         *     ResultSet rs3 = stmt.executeQuery("SELECT * FROM 401K_CONTRIB");
187         *     CachedRowSet fourO1k = new CachedRowSetImpl();
188         *     four01k.populate(rs3);
189         *     jrs.addRowSet(four01k, 1);
190         * </PRE>
191         * <P>
192         * The <code>JoinRowSet</code> object <i>jrs</i> now contains values from all three
193         * tables. The data in each row in <i>four01k</i> in which the value for the 
194         * <code>EMP_ID</code> column matches a value for the <code>EMP_ID</code> column 
195         * in <i>jrs</i> has been added to <i>jrs</i>.
196         * <P>
197         * <h3>4.0 <code>JoinRowSet</code> Methods</h3>
198         * The <code>JoinRowSet</code> interface supplies several methods for adding 
199         * <code>RowSet</code> objects and for getting information about the 
200         * <code>JoinRowSet</code> object.
201         * <UL>
202         *   <LI>Methods for adding one or more <code>RowSet</code> objects<BR>
203         *       These methods allow an application to add one <code>RowSet</code> object
204         *       at a time or to add multiple <code>RowSet</code> objects at one time. In
205         *       either case, the methods may specify the match column for each 
206         *       <code>RowSet</code> object being added.
207         *   <LI>Methods for getting information<BR>
208         *       One method retrieves the <code>RowSet</code> objects in the 
209         *       <code>JoinRowSet</code> object, and another method retrieves the 
210         *       <code>RowSet</code> names.  A third method retrieves either the SQL 
211         *       <code>WHERE</code> clause used behind the scenes to form the 
212         *       <code>JOIN</code> or a text description of what the <code>WHERE</code>
213         *       clause does.
214         *   <LI>Methods related to the type of <code>JOIN</code><BR>
215         *       One method sets the <code>JOIN</code> type, and five methods find out whether
216         *       the <code>JoinRowSet</code> object supports a given type.
217         *   <LI>A method to make a separate copy of the <code>JoinRowSet</code> object<BR>
218         *       This method creates a copy that can be persisted to the data source.
219         * </UL>
220         * <P>
221         */
222
223        public interface JoinRowSet extends WebRowSet {
224
225            /**
226             * Adds the given <code>RowSet</code> object to this <code>JoinRowSet</code>
227             * object. If the <code>RowSet</code> object
228             * is the first to be added to this <code>JoinRowSet</code>
229             * object, it forms the basis of the <code>JOIN</code> relationship to be 
230             * established.
231             * <P>
232             * This method should be used only when the given <code>RowSet</code>
233             * object already has a match column that was set with the <code>Joinable</code>
234             * method <code>setMatchColumn</code>.
235             * <p>
236             * Note: A <code>Joinable</code> object is any <code>RowSet</code> object
237             * that has implemented the <code>Joinable</code> interface. 
238             *
239             * @param rowset the <code>RowSet</code> object that is to be added to this
240             *        <code>JoinRowSet</code> object; it must implement the 
241             *        <code>Joinable</code> interface and have a match column set
242             * @throws SQLException if (1) an empty rowset is added to the to this
243             *         <code>JoinRowSet</code> object, (2) a match column has not been
244             *         set for <i>rowset</i>, or (3) <i>rowset</i>
245             *         violates the active <code>JOIN</code>
246             * @see Joinable#setMatchColumn
247             */
248            public void addRowSet(Joinable rowset) throws SQLException;
249
250            /**
251             * Adds the given <code>RowSet</code> object to this <code>JoinRowSet</code>
252             * object and sets the designated column as the match column for
253             * the <code>RowSet</code> object. If the <code>RowSet</code> object
254             * is the first to be added to this <code>JoinRowSet</code>
255             * object, it forms the basis of the <code>JOIN</code> relationship to be 
256             * established.
257             * <P>
258             * This method should be used when <i>RowSet</i> does not already have a match
259             * column set.
260             *
261             * @param rowset the <code>RowSet</code> object that is to be added to this
262             *        <code>JoinRowSet</code> object; it may implement the 
263             *        <code>Joinable</code> interface 
264             * @param columnIdx an <code>int</code> that identifies the column to become the
265             *         match column
266             * @throws SQLException if (1) <i>rowset</i> is an empty rowset or
267             *         (2) <i>rowset</i> violates the active <code>JOIN</code>
268             * @see Joinable#unsetMatchColumn
269             */
270            public void addRowSet(RowSet rowset, int columnIdx)
271                    throws SQLException;
272
273            /**
274             * Adds <i>rowset</i> to this <code>JoinRowSet</code> object and
275             * sets the designated column as the match column. If <i>rowset</i>
276             * is the first to be added to this <code>JoinRowSet</code>
277             * object, it forms the basis for the <code>JOIN</code> relationship to be 
278             * established. 
279             * <P>
280             * This method should be used when the given <code>RowSet</code> object
281             * does not already have a match column.     
282             * 
283             * @param rowset the <code>RowSet</code> object that is to be added to this
284             *        <code>JoinRowSet</code> object; it may implement the 
285             *        <code>Joinable</code> interface 
286             * @param columnName the <code>String</code> object giving the name of the 
287             *        column to be set as the match column
288             * @throws SQLException if (1) <i>rowset</i> is an empty rowset or
289             *         (2) the match column for <i>rowset</i> does not satisfy the
290             *         conditions of the <code>JOIN</code>
291             */
292            public void addRowSet(RowSet rowset, String columnName)
293                    throws SQLException;
294
295            /**
296             * Adds one or more <code>RowSet</code> objects contained in the given 
297             * array of <code>RowSet</code> objects to this <code>JoinRowSet</code> 
298             * object and sets the match column for
299             * each of the <code>RowSet</code> objects to the match columns 
300             * in the given array of column indexes. The first element in 
301             * <i>columnIdx</i> is set as the match column for the first
302             * <code>RowSet</code> object in <i>rowset</i>, the second element of
303             * <i>columnIdx</i> is set as the match column for the second element
304             * in <i>rowset</i>, and so on.
305             * <P>
306             * The first <code>RowSet</code> object added to this <code>JoinRowSet</code>
307             * object forms the basis for the <code>JOIN</code> relationship.
308             * <P>
309             * This method should be used when the given <code>RowSet</code> object
310             * does not already have a match column.
311             *
312             * @param rowset an array of one or more <code>RowSet</code> objects 
313             *        to be added to the <code>JOIN</code>; it may implement the 
314             *        <code>Joinable</code> interface  
315             * @param columnIdx an array of <code>int</code> values indicating the index(es)
316             *        of the columns to be set as the match columns for the <code>RowSet</code>
317             *        objects in <i>rowset</i>
318             * @throws SQLException if (1) an empty rowset is added to this 
319             *         <code>JoinRowSet</code> object, (2) a match column is not set
320             *         for a <code>RowSet</code> object in <i>rowset</i>, or (3) 
321             *         a <code>RowSet</code> object being added violates the active
322             *         <code>JOIN</code>
323             */
324            public void addRowSet(RowSet[] rowset, int[] columnIdx)
325                    throws SQLException;
326
327            /**
328             * Adds one or more <code>RowSet</code> objects contained in the given 
329             * array of <code>RowSet</code> objects to this <code>JoinRowSet</code> 
330             * object and sets the match column for
331             * each of the <code>RowSet</code> objects to the match columns 
332             * in the given array of column names. The first element in 
333             * <i>columnName</i> is set as the match column for the first
334             * <code>RowSet</code> object in <i>rowset</i>, the second element of
335             * <i>columnName</i> is set as the match column for the second element
336             * in <i>rowset</i>, and so on.
337             * <P>
338             * The first <code>RowSet</code> object added to this <code>JoinRowSet</code>
339             * object forms the basis for the <code>JOIN</code> relationship.
340             * <P>
341             * This method should be used when the given <code>RowSet</code> object(s)
342             * does not already have a match column.
343             *
344             * @param rowset an array of one or more <code>RowSet</code> objects 
345             *        to be added to the <code>JOIN</code>; it may implement the 
346             *        <code>Joinable</code> interface 
347             * @param columnName an array of <code>String</code> values indicating the 
348             *        names of the columns to be set as the match columns for the 
349             *        <code>RowSet</code> objects in <i>rowset</i>
350             * @throws SQLException if (1) an empty rowset is added to this 
351             *         <code>JoinRowSet</code> object, (2) a match column is not set
352             *         for a <code>RowSet</code> object in <i>rowset</i>, or (3) 
353             *         a <code>RowSet</code> object being added violates the active
354             *         <code>JOIN</code>
355             */
356            public void addRowSet(RowSet[] rowset, String[] columnName)
357                    throws SQLException;
358
359            /**
360             * Returns a <code>Collection</code> object containing the 
361             * <code>RowSet</code> objects that have been added to this
362             * <code>JoinRowSet</code> object.
363             * This should return the 'n' number of RowSet contained
364             * within the <code>JOIN</code> and maintain any updates that have occured while in
365             * this union.
366             * 
367             * @return a <code>Collection</code> object consisting of the 
368             *        <code>RowSet</code> objects added to this <code>JoinRowSet</code>
369             *        object
370             * @throws SQLException if an error occurs generating the 
371             *         <code>Collection</code> object to be returned
372             */
373            public Collection<?> getRowSets() throws java.sql.SQLException;
374
375            /**
376             * Returns a <code>String</code> array containing the names of the
377             *         <code>RowSet</code> objects added to this <code>JoinRowSet</code>
378             *         object.
379             *
380             * @return a <code>String</code> array of the names of the
381             *         <code>RowSet</code> objects in this <code>JoinRowSet</code>
382             *         object
383             * @throws SQLException if an error occurs retrieving the names of
384             *         the <code>RowSet</code> objects
385             * @see CachedRowSet#setTableName
386             */
387            public String[] getRowSetNames() throws java.sql.SQLException;
388
389            /**
390             * Creates a new <code>CachedRowSet</code> object containing the 
391             * data in this <code>JoinRowSet</code> object, which can be saved
392             * to a data source using the <code>SyncProvider</code> object for
393             * the <code>CachedRowSet</code> object.
394             * <P>
395             * If any updates or modifications have been applied to the JoinRowSet
396             * the CachedRowSet returned by the method will not be able to persist
397             * it's changes back to the originating rows and tables in the 
398             * in the datasource. The CachedRowSet instance returned should not
399             * contain modification data and it should clear all properties of
400             * it's originating SQL statement. An application should reset the
401             * SQL statement using the <code>RowSet.setCommand</code> method.
402             * <p>
403             * In order to allow changes to be persisted back to the datasource
404             * to the originating tables, the <code>acceptChanges</code> method
405             * should be used and called on a JoinRowSet object instance. Implementations
406             * can leverage the internal data and update tracking in their 
407             * implementations to interact with the SyncProvider to persist any
408             * changes. 
409             *
410             * @return a CachedRowSet containing the contents of the JoinRowSet
411             * @throws SQLException if an error occurs assembling the CachedRowSet
412             * object 
413             * @see javax.sql.RowSet
414             * @see javax.sql.rowset.CachedRowSet
415             * @see javax.sql.rowset.spi.SyncProvider
416             */
417            public CachedRowSet toCachedRowSet() throws java.sql.SQLException;
418
419            /**
420             * Indicates if CROSS_JOIN is supported by a JoinRowSet 
421             * implementation
422             *
423             * @return true if the CROSS_JOIN is supported; false otherwise
424             */
425            public boolean supportsCrossJoin();
426
427            /**
428             * Indicates if INNER_JOIN is supported by a JoinRowSet 
429             * implementation
430             *
431             * @return true is the INNER_JOIN is supported; false otherwise
432             */
433            public boolean supportsInnerJoin();
434
435            /**
436             * Indicates if LEFT_OUTER_JOIN is supported by a JoinRowSet 
437             * implementation
438             *
439             * @return true is the LEFT_OUTER_JOIN is supported; false otherwise
440             */
441            public boolean supportsLeftOuterJoin();
442
443            /**
444             * Indicates if RIGHT_OUTER_JOIN is supported by a JoinRowSet 
445             * implementation
446             *
447             * @return true is the RIGHT_OUTER_JOIN is supported; false otherwise
448             */
449            public boolean supportsRightOuterJoin();
450
451            /**
452             * Indicates if FULL_JOIN is supported by a JoinRowSet 
453             * implementation
454             *
455             * @return true is the FULL_JOIN is supported; false otherwise
456             */
457            public boolean supportsFullJoin();
458
459            /**
460             * Allow the application to adjust the type of <code>JOIN</code> imposed
461             * on tables contained within the JoinRowSet object instance.
462             * Implementations should throw a SQLException if they do 
463             * not support a given <code>JOIN</code> type.
464             *
465             * @param joinType the standard JoinRowSet.XXX static field definition
466             * of a SQL <code>JOIN</code> to re-configure a JoinRowSet instance on
467             * the fly.
468             * @throws SQLException if an unsupported <code>JOIN</code> type is set
469             * @see #getJoinType
470             */
471            public void setJoinType(int joinType) throws SQLException;
472
473            /**
474             * Return a SQL-like description of the WHERE clause being used
475             * in a JoinRowSet object. An implementation can describe
476             * the WHERE clause of the SQL <code>JOIN</code> by supplying a SQL
477             * strings description of <code>JOIN</code> or provide a textual
478             * description to assist applications using a <code>JoinRowSet</code>
479             *
480             * @return whereClause a textual or SQL description of the logical
481             * WHERE clause used in the JoinRowSet instance
482             * @throws SQLException if an error occurs in generating a representation
483             * of the WHERE clause.
484             */
485            public String getWhereClause() throws SQLException;
486
487            /**
488             * Returns a <code>int</code> describing the set SQL <code>JOIN</code> type 
489             * governing this JoinRowSet instance. The returned type will be one of
490             * standard JoinRowSet types: <code>CROSS_JOIN</code>, <code>INNER_JOIN</code>, 
491             * <code>LEFT_OUTER_JOIN</code>, <code>RIGHT_OUTER_JOIN</code> or 
492             * <code>FULL_JOIN</code>.
493             *
494             * @return joinType one of the standard JoinRowSet static field 
495             *     definitions of a SQL <code>JOIN</code>. <code>JoinRowSet.INNER_JOIN</code>
496             *     is returned as the default <code>JOIN</code> type is no type has been
497             *     explicitly set.
498             * @throws SQLException if an error occurs determining the SQL <code>JOIN</code>
499             *     type supported by the JoinRowSet instance.
500             * @see #setJoinType
501             */
502            public int getJoinType() throws SQLException;
503
504            /**
505             * An ANSI-style <code>JOIN</code> providing a cross product of two tables
506             */
507            public static int CROSS_JOIN = 0;
508
509            /**
510             * An ANSI-style <code>JOIN</code> providing a inner join between two tables. Any
511             * unmatched rows in either table of the join should be discarded.
512             */
513            public static int INNER_JOIN = 1;
514
515            /**
516             * An ANSI-style <code>JOIN</code> providing a left outer join between two
517             * tables. In SQL, this is described where all records should be 
518             * returned from the left side of the JOIN statement.
519             */
520            public static int LEFT_OUTER_JOIN = 2;
521
522            /**
523             * An ANSI-style <code>JOIN</code> providing a right outer join between
524             * two tables. In SQL, this is described where all records from the
525             * table on the right side of the JOIN statement even if the table 
526             * on the left has no matching record.
527             */
528            public static int RIGHT_OUTER_JOIN = 3;
529
530            /**
531             * An ANSI-style <code>JOIN</code> providing a a full JOIN. Specifies that all 
532             * rows from either table be returned regardless of matching
533             * records on the other table.
534             */
535            public static int FULL_JOIN = 4;
536
537        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.