org.xquark.xml.xdbc
Interface XMLStatement

All Known Subinterfaces:
PreparedXMLStatement

public interface XMLStatement

This statement interface is used for executing constant XQuery or XPath statements and obtaining the results produced (update statements are not supported yet).


Method Summary
 void close()
          Releases the statement XMLDBC resources immediately instead of waiting for this to happen when it is automatically closed.
 boolean execute(java.lang.String query)
          Executes a query statement of the type specified when this object was built with the createStatement method (see XMLConnection interface) that may return results.
 boolean execute(java.lang.String query, int queryType)
          Executes a query statement of the specified type that may return results.
 XMLDocumentSet executeDocumentQuery(java.lang.String query)
          Executes a query statement of the type specified when this object was built with the createStatement method (see XMLConnection interface) that returns complete XML documents.
 XMLDocumentSet executeDocumentQuery(java.lang.String query, int queryType)
          Executes a query statement of the specified type that returns complete XML documents.
 XMLResultSet executeQuery(java.lang.String query)
          Executes a query statement of the type specified when this object was built with the createStatement method (see XMLConnection interface) that returns results.
 XMLResultSet executeQuery(java.lang.String query, int queryType)
          Executes a query statement of the specified type that returns results.
 java.lang.String getBaseURI()
          gets the base URI for documents.
 XMLConnection getConnection()
          Returns the connection object that produced this statement.
 XMLDocumentSet getDocumentSet()
          Returns the current statement results as an XMLDocumentSet object.
 XMLResultSet getResultSet()
          Returns the current statement results as an XMLResultSet object.
 void setBaseURI(java.lang.String baseURI)
          Sets the base URI for documents.
 

Method Detail

execute

public boolean execute(java.lang.String query)
                throws XMLDBCException
Executes a query statement of the type specified when this object was built with the createStatement method (see XMLConnection interface) that may return results. If the query generates results, use the getResultSet() or getDocumentSet() methods to get the set of results.

Parameters:
query - the query string.
Returns:
true if there are available resuts, else false.
Throws:
XMLDBCException - if a data source access error occurs.

execute

public boolean execute(java.lang.String query,
                       int queryType)
                throws XMLDBCException
Executes a query statement of the specified type that may return results. If the query generates results, use the getResultSet() or getDocumentSet() methods to get the set of results.

Parameters:
query - the query string.
queryType - the type of query for this statement (see constants in XMLConnection interface).
Returns:
true if there are available resuts, else false.
Throws:
XMLDBCException - if a data source access error occurs.

executeQuery

public XMLResultSet executeQuery(java.lang.String query)
                          throws XMLDBCException
Executes a query statement of the type specified when this object was built with the createStatement method (see XMLConnection interface) that returns results.

Parameters:
query - the query string
Returns:
an XMLResultSet object that contains the data produced by the given query.
Throws:
XMLDBCException - if a data source access error occurs.

executeQuery

public XMLResultSet executeQuery(java.lang.String query,
                                 int queryType)
                          throws XMLDBCException
Executes a query statement of the specified type that returns results. If the query generates results, use the getResultSet() or getDocumentSet() methods to get the set of results.

Parameters:
query - the query string.
queryType - the type of query for this statement (see constants in XMLConnection interface).
Returns:
true if there are available resuts, else false.
Throws:
XMLDBCException - if a data source access error occurs.

executeDocumentQuery

public XMLDocumentSet executeDocumentQuery(java.lang.String query)
                                    throws XMLDBCException
Executes a query statement of the type specified when this object was built with the createStatement method (see XMLConnection interface) that returns complete XML documents. It is a error to call this method with a query that returns document fragments.

Parameters:
query - a static and read-only query in the specified type.
Returns:
an XMLResultSet object that contains the data produced by the given query.
Throws:
XMLDBCException - if a data source access error occurs, or if the returned results are not complete XML documents.

executeDocumentQuery

public XMLDocumentSet executeDocumentQuery(java.lang.String query,
                                           int queryType)
                                    throws XMLDBCException
Executes a query statement of the specified type that returns complete XML documents. It is a error to call this method with a query that returns document fragments.

Parameters:
query - the query string.
queryType - the type of query for this statement (see constants in XMLConnection interface).
Returns:
true if there are available resuts, else false.
Throws:
XMLDBCException - if a data source access error occurs, or if the returned results are not complete XML documents.

getResultSet

public XMLResultSet getResultSet()
                          throws XMLDBCException
Returns the current statement results as an XMLResultSet object.

Returns:
the current results as an XMLResultSet object or null if there is no result.
Throws:
XMLDBCException - if a data source access error occurs.

getDocumentSet

public XMLDocumentSet getDocumentSet()
                              throws XMLDBCException
Returns the current statement results as an XMLDocumentSet object. It is a error to call this method for a statement that returned document fragments.

Returns:
the current results as an XMLDocumentSet object or null if there is no result.
Throws:
XMLDBCException - if a data source access error occurs, or if the returned results are not complete XML documents.

getConnection

public XMLConnection getConnection()
Returns the connection object that produced this statement.

Returns:
the connection object that produced this statement.

close

public void close()
           throws XMLDBCException
Releases the statement XMLDBC resources immediately instead of waiting for this to happen when it is automatically closed.

Throws:
XMLDBCException - if a data source access error occurs.

setBaseURI

public void setBaseURI(java.lang.String baseURI)
Sets the base URI for documents.

Returns:
nothing

getBaseURI

public java.lang.String getBaseURI()
gets the base URI for documents.

Returns:
the base URI


Copyright © 2004 Université de Versailles Saint-Quentin, XQuark Group. All rights reserved.