KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > xquery > xdbc > XDBCResultSetInterface


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.xquery.xdbc;
24 import org.xquark.schema.validation.PSVInfoSetProvider;
25 import org.xquark.xml.xdbc.XMLDBCException;
26
27 /**
28  * Internal interface between the common XDBC result set implementation (
29  * {@link org.xquark.xquery.xdbc.XResultSetImpl} using the reconstruction
30  * visitor from the XQuery front-end) and the XQuery back-end.
31  */

32 public interface XDBCResultSetInterface
33 {
34         
35     /**
36      * Return the value of the element specified by the path.
37      * @param path
38      * @param nodeAccessor
39      * @param loopID the ID of the loop concerned if any
40      * @return value of the element
41      * @throws XDBCException if a database access error occurs.
42      */

43     public String JavaDoc fetch(String JavaDoc path,int nodeAccessor,String JavaDoc loopID, PSVInfoSetProvider psvisp) throws XMLDBCException;
44     public String JavaDoc fetch(String JavaDoc path,int nodeAccessor,String JavaDoc loopID) throws XMLDBCException;
45     public String JavaDoc fetch(String JavaDoc path,int nodeAccessor) throws XMLDBCException;
46
47     /**
48      * Generate the value of the result set specified by the path in the handler.
49      * @param path
50      * @param nodeAccessor the type of node to be generated
51      * @param loopID the ID of the loop concerned if any
52      * @throws XDBCException if a database access error occurs.
53      */

54     public void generate(String JavaDoc path,int nodeAccessor,String JavaDoc loopID, PSVInfoSetProvider psvisp) throws XMLDBCException;
55     public void generate(String JavaDoc path,int nodeAccessor,String JavaDoc loopID) throws XMLDBCException;
56     public void generate(String JavaDoc path,int nodeAccessor) throws XMLDBCException;
57
58     /**
59      * Recover the identifiers of the current result set and stores them in the table <I>identifiers</I>.
60      * @param identifiers the table of identifiers
61      * @throws XDBCException if a database access error occurs.
62      */

63     public void getIdentifiers(Object JavaDoc[] identifiers) throws XMLDBCException;
64
65     /**
66      * Recover the identifiers of the next result set and stores them in the table <I>identifiers</I>.
67      * @param identifiers the table of identifiers
68      * @throws XDBCException if a database access error occurs.
69      */

70     public void getNextIdentifiers(Object JavaDoc[] identifiers) throws XMLDBCException;
71
72     /**
73      * Give the new current result set (the next one).
74      * @return true if the new current result set is valid, false otherwise
75      * @throws XDBCException if a database access error occurs.
76      */

77     public boolean next() throws XMLDBCException;
78
79     /**
80      * Returns true if the result set has more elements.
81      * @return true if the result set has more elements, false otherwise
82      */

83     public boolean hasNext() throws XMLDBCException;
84
85     /**
86      * To set a content handler (SAX 2) to intercept events produce when retrieves results by SAX 2 way.
87      * @param handler the content handler implementation (see org.xml.sax.ContentHandler)
88      * @throws XDBCException if a database access error occurs.
89      */

90     public void setContentHandler(org.xml.sax.ContentHandler JavaDoc handler);
91
92     /**
93      * To set a lexical handler (SAX 2) to intercept events produce when retrieves results by SAX 2 way.
94      * @param handler the lexical handler implementation (see org.xml.sax.ext.LexicalHandler)
95      * @throws XDBCException if a database access error occurs.
96      */

97     public void setLexicalHandler(org.xml.sax.ext.LexicalHandler JavaDoc handler);
98
99     /**
100      * To set a content handler (SAX 2) to intercept events produce when retrieves results by SAX 2 way.
101      * @param handler the error handler implementation (see org.xml.sax.ErrorHandler)
102      * @throws XDBCException if a database access error occurs.
103      */

104     public void setErrorHandler(org.xml.sax.ErrorHandler JavaDoc handler);
105
106     /**
107      * Releases this result set object's resources immediately instead of waiting
108      * for this to happen when it is automatically closed.<BR>
109      * <B>Note:</B> A XResultSet object is automatically closed by the XStatement
110      * object that generated it when that XStatement object is closed,
111      * re-executed, or is used to retrieve the next result from a sequence of
112      * multiple results.
113      * @throws XMLDBCException if a data source access error occurs.
114      */

115     public void close() throws XMLDBCException;
116 }
117
Popular Tags