org.xquark.xml.xdbc
Interface PreparedXMLStatement

All Superinterfaces:
XMLStatement

public interface PreparedXMLStatement
extends XMLStatement

This prepared statement interface is used for executing parameterized XQuery or XPath prepared statements, setting parameters and obtaining the results (update statements are not supported yet).
Prepared statements allow queries precompilation by the driver.


Method Summary
 void clearParameters()
          Clears the current parameters values immediately.
 boolean execute()
          Executes the query statement specified when this object was built with the prepareStatement method (see XMLConnection interface) that may return results.
 XMLResultSet executeQuery()
          Executes the query statement specified when this object was built with the prepareStatement method (see XMLConnection interface) that returns results.
 void setBase64Binary(int parameterIndex, java.io.InputStream value, int length)
          To set the specified parameter whose index is parameterIndex with a Base64Binary value.
 void setBigDecimal(int parameterIndex, java.math.BigDecimal value)
          To set the specified parameter whose index is parameterIndex with a java.math.BigDecimal value.
 void setBoolean(int parameterIndex, boolean value)
          To set the specified parameter whose index is parameterIndex with a boolean value.
 void setByte(int parameterIndex, byte value)
          To set the specified parameter whose index is parameterIndex with a byte value.
 void setBytes(int parameterIndex, byte[] value)
          To set the specified parameter whose index is parameterIndex with a byte array value.
 void setDate(int parameterIndex, java.sql.Date value)
          To set the specified parameter whose index is parameterIndex with a java.sql.Date value.
 void setDateTime(int parameterIndex, java.sql.Timestamp value)
          To set the specified parameter whose index is parameterIndex with an universal date and time value.
 void setDouble(int parameterIndex, double value)
          To set the specified parameter whose index is parameterIndex with a double value.
 void setFloat(int parameterIndex, float value)
          To set the specified parameter whose index is parameterIndex with a float value.
 void setHexBinary(int parameterIndex, java.io.InputStream value, int length)
          To set the specified parameter whose index is parameterIndex with a HexBinary value.
 void setInt(int parameterIndex, int value)
          To set the specified parameter whose index is parameterIndex with an int value.
 void setLong(int parameterIndex, long value)
          To set the specified parameter whose index is parameterIndex with a long value.
 void setObject(int parameterIndex, java.lang.Object value)
          To set the specified parameter whose index is parameterIndex with a value (inside an object) using the Java/XML type conversion.
 void setParameter(int parameterIndex, java.lang.String value)
          To set the specified parameter whose index is parameterIndex with a value (as a String) without using the Java/XML type conversion.
 void setShort(int parameterIndex, short value)
          To set the specified parameter whose index is parameterIndex with a short value.
 void setString(int parameterIndex, java.lang.String value)
          To set the specified parameter whose index is parameterIndex with a string value.
 void setTime(int parameterIndex, java.sql.Time value)
          To set the specified parameter whose index is parameterIndex with a java.sql.Time value.
 
Methods inherited from interface org.xquark.xml.xdbc.XMLStatement
close, execute, execute, executeDocumentQuery, executeDocumentQuery, executeQuery, executeQuery, getBaseURI, getConnection, getDocumentSet, getResultSet, setBaseURI
 

Method Detail

setParameter

public void setParameter(int parameterIndex,
                         java.lang.String value)
                  throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a value (as a String) without using the Java/XML type conversion.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a string that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setObject

public void setObject(int parameterIndex,
                      java.lang.Object value)
               throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a value (inside an object) using the Java/XML type conversion.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - an object that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          java.math.BigDecimal value)
                   throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a java.math.BigDecimal value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a java.math.BigDecimal that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setBase64Binary

public void setBase64Binary(int parameterIndex,
                            java.io.InputStream value,
                            int length)
                     throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a Base64Binary value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a Base64Binary (in an input stream) that is the value to set for the parameter.
length - the length of given input stream.
Throws:
XMLDBCException - if a data source access error occurs.

setHexBinary

public void setHexBinary(int parameterIndex,
                         java.io.InputStream value,
                         int length)
                  throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a HexBinary value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a HexBinary (in an input stream) that is the value to set for the parameter.
length - the length of given input stream.
Throws:
XMLDBCException - if a data source access error occurs.

setBoolean

public void setBoolean(int parameterIndex,
                       boolean value)
                throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a boolean value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a boolean that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setByte

public void setByte(int parameterIndex,
                    byte value)
             throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a byte value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a byte that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setBytes

public void setBytes(int parameterIndex,
                     byte[] value)
              throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a byte array value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a byte array that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setDate

public void setDate(int parameterIndex,
                    java.sql.Date value)
             throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a java.sql.Date value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a java.sql.Date that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setDateTime

public void setDateTime(int parameterIndex,
                        java.sql.Timestamp value)
                 throws XMLDBCException
To set the specified parameter whose index is parameterIndex with an universal date and time value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a java.util.GregorianCalendar (an universal date and time) that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setDouble

public void setDouble(int parameterIndex,
                      double value)
               throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a double value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a double that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setFloat

public void setFloat(int parameterIndex,
                     float value)
              throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a float value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a float that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setInt

public void setInt(int parameterIndex,
                   int value)
            throws XMLDBCException
To set the specified parameter whose index is parameterIndex with an int value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - an int that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setLong

public void setLong(int parameterIndex,
                    long value)
             throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a long value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a long that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setShort

public void setShort(int parameterIndex,
                     short value)
              throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a short value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a short that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setString

public void setString(int parameterIndex,
                      java.lang.String value)
               throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a string value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a string that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

setTime

public void setTime(int parameterIndex,
                    java.sql.Time value)
             throws XMLDBCException
To set the specified parameter whose index is parameterIndex with a java.sql.Time value.

Parameters:
parameterIndex - index of parameter (first parameter has index 1).
value - a java.sql.Time that is the value to set for the parameter.
Throws:
XMLDBCException - if a data source access error occurs.

clearParameters

public void clearParameters()
                     throws XMLDBCException
Clears the current parameters values immediately.

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

execute

public boolean execute()
                throws XMLDBCException
Executes the query statement specified when this object was built with the prepareStatement 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.

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

executeQuery

public XMLResultSet executeQuery()
                          throws XMLDBCException
Executes the query statement specified when this object was built with the prepareStatement method (see XMLConnection interface) that returns results.

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


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