com.softwareag.tamino.db.api.accessor
Class TPreparedXQuery
java.lang.Object
com.softwareag.tamino.db.api.accessor.TXQuery
com.softwareag.tamino.db.api.accessor.TPreparedXQuery
- All Implemented Interfaces:
- TXQDynamicContext, java.io.Serializable
public class TPreparedXQuery
- extends TXQuery
TPreparedXQuery represents a Tamino xquery expression. It wraps a Tamino xquery expression.
With with 4.4 Tamino enables seperate compilation and execution of XQueries. Tamino Java APIs support
this feature through TPreparedXQuery. Live time of a prepared query is bounded to the enclosing session.
All prepared queries die with closing the session.
Example-
// Get tamino connection, use local transaction mode
connection = getConnection();
connection.useLocalTransactionMode();
// Get XML object accessor
accessor = connection.newXMLObjectAccessor();
// Prepare XQuery using connection object
TPreparedXQuery query = connection.prepareQuery("declare variable $y as xs:string external for $q in
input()/Acount[ID=$y] return $q");
// Bind external variables
query.bindString(new QName( "y"),"111-222-333");
// Execute prepared XQuery
TResponse response = accessor.xquery(query);
- Version:
- $Revision: 1.2 $
- Author:
- Vikram Shinde
- See Also:
- Serialized Form
Constructor Summary |
TPreparedXQuery(java.lang.String expression)
Initializes the query with the given XQuery expression. |
Method Summary |
java.lang.String |
getHandle()
Returns the handle to Prepared XQuery. |
void |
setHandle(java.lang.String handle)
Sets the handle of Prepared XQuery, that was returned by server after executing _PREPARE command. |
Methods inherited from class com.softwareag.tamino.db.api.accessor.TXQuery |
bindBase64Binary, bindBoolean, bindByte, bindDate, bindDateTime, bindDecimal, bindDouble, bindDuration, bindEntity, bindFloat, bindGDay, bindGMonth, bindGMonthDay, bindGYear, bindGYearMonth, bindHexBinary, bindID, bindIDRef, bindInt, bindInteger, bindLanguage, bindLong, bindName, bindNCName, bindNegativeInteger, bindNMToken, bindNonNegativeInteger, bindNonPositiveInteger, bindNormalizedString, bindNotation, bindPositiveInteger, bindQName, bindSequence, bindSequence, bindShort, bindString, bindTime, bindToken, bindUnsignedByte, bindUnsignedInt, bindUnsignedLong, bindUnsignedShort, bindURI, equals, getExpression, getMediaType, getOutputMethod, getQuerySearchMode, getSensitive, hashCode, newInstance, setExpression, setMediaType, setOutputMethod, setQuerySearchMode, setSensitive, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
TPreparedXQuery
public TPreparedXQuery(java.lang.String expression)
- Initializes the query with the given XQuery expression.
- Parameters:
expression
- is the xquery expression.
getHandle
public java.lang.String getHandle()
- Returns the handle to Prepared XQuery.
setHandle
public void setHandle(java.lang.String handle)
- Sets the handle of Prepared XQuery, that was returned by server after executing _PREPARE command.
Copyright (c) 2013 Software AG. All Rights Reserved.