|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This prepared statement interface is used for executing parameterized XQuery
or XPath prepared statements, setting external variables and obtaining the
results (update statements are not supported yet).
Prepared statements allow queries precompilation by the driver.
In order to binds external variables, two kinds of methods are available:
setExternalVariable(String, String, String)
assumes that the
value be parsed and validated.
Method Summary | |
void |
clearVariables()
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 |
setBigDecimal(java.lang.String ns,
java.lang.String varName,
java.math.BigDecimal value)
To set the specified variable with a @link java.math.BigDecimal value. |
void |
setBoolean(java.lang.String ns,
java.lang.String varName,
boolean value)
To set the specified variable with a boolean value. |
void |
setBytes(java.lang.String ns,
java.lang.String varName,
byte[] value)
To set the specified variable with a byte array value. |
void |
setDate(java.lang.String ns,
java.lang.String varName,
java.util.Date value)
To set the specified variable with a @link java.util.Date value. |
void |
setDouble(java.lang.String ns,
java.lang.String varName,
double value)
To set the specified variable with a double value. |
void |
setExternalVariable(java.lang.String ns,
java.lang.String varName,
java.lang.String value)
Binds the specified external variable to the current query of the statement. |
void |
setFloat(java.lang.String ns,
java.lang.String varName,
float value)
To set the specified variable with a float value. |
void |
setInputStream(java.lang.String ns,
java.lang.String varName,
java.io.InputStream value,
int length)
To set the specified variable with a @link java.io.InputStream value. |
void |
setLong(java.lang.String ns,
java.lang.String varName,
long value)
To set the specified variable with a long value. |
void |
setObject(java.lang.String ns,
java.lang.String varName,
java.lang.Object value)
To set the specified variable with a value inside an object. |
void |
setString(java.lang.String ns,
java.lang.String varName,
java.lang.String value)
To set the specified variable with a String value. |
Methods inherited from interface org.xquark.xml.xdbc.XMLStatement |
close, execute, execute, executeDocumentQuery, executeDocumentQuery, executeQuery, executeQuery, getBaseURI, getConnection, getDocumentSet, getResultSet, setBaseURI |
Method Detail |
public void setExternalVariable(java.lang.String ns, java.lang.String varName, java.lang.String value) throws XMLDBCException
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a string that is the value to set for the variable.
XMLDBCException
- if a data source access error occurs.public void setObject(java.lang.String ns, java.lang.String varName, java.lang.Object value) throws XMLDBCException
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- an object that is the value to set for the parameter.
XMLDBCException
- if a data source access error occurs.public void setBigDecimal(java.lang.String ns, java.lang.String varName, java.math.BigDecimal value) throws XMLDBCException
decimal
.
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a @link java.math.BigDecimal that is the value to set for
the variable.
XMLDBCException
- if a data source access error occurs.public void setInputStream(java.lang.String ns, java.lang.String varName, java.io.InputStream value, int length) throws XMLDBCException
Base64Binary
or
HexBinary
.
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- an input stream.length
- the length of given input stream.
XMLDBCException
- if a data source access error occurs.public void setBytes(java.lang.String ns, java.lang.String varName, byte[] value) throws XMLDBCException
Base64Binary
or HexBinary
.
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a byte array that is the value to set for the parameter.
XMLDBCException
- if a data source access error occurs.public void setBoolean(java.lang.String ns, java.lang.String varName, boolean value) throws XMLDBCException
boolean
.
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a boolean that is the value to set for the parameter.
XMLDBCException
- if a data source access error occurs.public void setDate(java.lang.String ns, java.lang.String varName, java.util.Date value) throws XMLDBCException
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a java.sql.Date that is the value to set for the parameter.
XMLDBCException
- if a data source access error occurs.public void setDouble(java.lang.String ns, java.lang.String varName, double value) throws XMLDBCException
double
.
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a double that is the value to set for the parameter.
XMLDBCException
- if a data source access error occurs.public void setFloat(java.lang.String ns, java.lang.String varName, float value) throws XMLDBCException
float
.
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a float that is the value to set for the parameter.
XMLDBCException
- if a data source access error occurs.public void setLong(java.lang.String ns, java.lang.String varName, long value) throws XMLDBCException
integer
.
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a long that is the value to set for the parameter.
XMLDBCException
- if a data source access error occurs.public void setString(java.lang.String ns, java.lang.String varName, java.lang.String value) throws XMLDBCException
string
.
ns
- The namespace of the external variable. Possibly null if the
default namespace is to be used.varName
- local name of the external variable. Must not be null.value
- a string that is the value to set for the parameter.
XMLDBCException
- if a data source access error occurs.public void clearVariables() throws XMLDBCException
XMLDBCException
- if a data source access error occurs.public boolean execute() throws XMLDBCException
XMLDBCException
- if a data source access error occurs.public XMLResultSet executeQuery() throws XMLDBCException
XMLDBCException
- if a data source access error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |