Well, there is another approach to get the required JARS
, you need not install oracle database for that. I found the solution in this link,
http://orafmwsoa.blogspot.co.at/2014/06/running-xquery-from-java-applications.html
But you need not go through the entire link, what important point to note is, all necessary JARS
are available from Oracle XQuery for Hadoop implementation.
And here is the link,
Oracle XQuery for Hadoop 2.4.1
Just download Oracle XQuery for Hadoop 4.1.0
and extract and create a normal Java Project with the libraries in path.
I tried this example from your link, and it works
import javax.xml.xquery.XQConnection;
import javax.xml.xquery.XQException;
import javax.xml.xquery.XQPreparedExpression;
import javax.xml.xquery.XQSequence;
import oracle.xml.xquery.OXQDataSource;
public class HelloWorld {
public static void main(String[] args) throws XQException {
OXQDataSource ds = new OXQDataSource();
XQConnection con = ds.getConnection();
String query = "<hello-world>{1 + 1}</hello-world>";
XQPreparedExpression expr = con.prepareExpression(query);
XQSequence result = expr.executeQuery();
System.out.println(result.getSequenceAsString(null));
result.close();
expr.close();
con.close();
}
}
With following JARS
in path,
apache-xmlbeans
orai18n-mapping
oxquery
xmlparserv2_sans_jaxp_services
xqjapi
Also another suggestion,
- I installed Oracle Express Edition 11.2
OracleXE112_Win64
and it didn't had the required JARS
, XE may be has limited functionality, so try installing different one.
- Also this link here Embedding XQuery in Java suggests usage of SAXON XSLT & XQuery processor. SAXON