|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.xquery.XQueryContext
XQuerycontext - This class provides the context for executing XQueries
This class can be used to create a context from which queries can be
run. For instance, we can execute a bunch of function registeration calls
and then run a XQuery over it.
This is the main class to be called for executing XQUery
Example XQueryContext ctx = new XQueryContext(); try { // create a string from the file Reader strm = new FileReader("exmpl1.xml"); // prepare the query PreparedXQuery xq = ctx.prepareXQuery(strm); // get a resultset XQueryResultSet rset = xq.executeQuery(printPlan); while (rset.next()) { XMLNode node = rset.getNode(); // get the result nodes System.out.println(" NODE "+ node.getNodeName()); node.print(System.out); } } catch (Exception e) { // do something.. }
Constructor Summary | |
XQueryContext()
Constructor for the XQueryContext |
|
XQueryContext(java.sql.Connection conn)
Constructor for the XQueryContext |
|
XQueryContext(java.sql.Connection conn,
java.lang.String baseurl)
Constructor for the XQueryContext |
|
XQueryContext(java.lang.String baseurl)
Constructor for the XQueryContext |
|
XQueryContext(XQMesg msg)
Constructor for the XQueryContext |
Method Summary | |
java.lang.String |
getBaseUrl()
Get the baseurl registered with the context |
java.lang.String |
getXQueryStrFromXQX(java.lang.String xqueryx,
PreparedXQuery prepXquery)
|
static void |
main(java.lang.String[] argv)
|
PreparedXQuery |
prepareXQuery(java.io.Reader xquery)
Prepare a xquery for execution |
PreparedXQuery |
prepareXQuery(java.lang.String xquery)
Prepare a xquery for execution |
PreparedXQuery |
prepareXQueryX(java.io.Reader xqueryx)
Prepare a xquery for execution (XQueryX) |
PreparedXQuery |
prepareXQueryX(java.lang.String xqueryx)
Prepare a xquery for execution (XQueryX) |
void |
registerDatasource(java.lang.String dsname,
XMLDataSource dsimpl)
Register datasource |
void |
registerFunction(java.lang.String function)
Register a function for later evaluation |
void |
setBaseUrl(java.lang.String baseurl)
Set the baseurl for the context |
void |
setConnectionDesc(java.lang.String descname,
java.sql.Connection conn)
Set connection descriptor in the case when multiple connections are required. |
void |
setDefaultConnection(java.sql.Connection conn)
Sets the default SQL connection |
void |
setQueryTransform(oracle.xml.parser.v2.XSLStylesheet xslt)
Set a XSL-T transform on the XQueryX before execution This can be used for enforcing security (VPD) on the query or for auditing purposes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XQueryContext()
public XQueryContext(XQMesg msg)
msg
- Message descriptor (for locale specific messages)public XQueryContext(java.sql.Connection conn)
conn
- database connectionpublic XQueryContext(java.lang.String baseurl)
baseurl
- = the base url to be used for the file name resolutionpublic XQueryContext(java.sql.Connection conn, java.lang.String baseurl)
conn
- - the connection to be used for SQL statementsbaseurl
- = the base url to be used for the file name resolutionMethod Detail |
public void setDefaultConnection(java.sql.Connection conn)
conn
- The SQL connectionpublic void setConnectionDesc(java.lang.String descname, java.sql.Connection conn)
descname
- The name for the connectionconn
- database connectionpublic void registerDatasource(java.lang.String dsname, XMLDataSource dsimpl)
dsname
- The name for the connectiondsimpl
- datasource implementationpublic PreparedXQuery prepareXQuery(java.lang.String xquery) throws XQException
xquery
- - the XQuery string to be executedpublic PreparedXQuery prepareXQuery(java.io.Reader xquery) throws XQException
xquery
- - the XQuery string to be executedpublic PreparedXQuery prepareXQueryX(java.lang.String xqueryx) throws XQException
xqueryx
- - the XQueryX string to be executedpublic PreparedXQuery prepareXQueryX(java.io.Reader xqueryx) throws XQException
xqueryx
- - the XQueryX string to be executedpublic void setQueryTransform(oracle.xml.parser.v2.XSLStylesheet xslt)
xslt
- - the XSLT to be usedpublic void setBaseUrl(java.lang.String baseurl)
baseurl
- - the baseuri to be setpublic java.lang.String getBaseUrl()
baseurl
- - the baseuri to be setpublic void registerFunction(java.lang.String function) throws XQException
function
- - the function to be registeredpublic java.lang.String getXQueryStrFromXQX(java.lang.String xqueryx, PreparedXQuery prepXquery)
public static void main(java.lang.String[] argv)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |