Jena Adapter 11.2.0.3 Rebuild To Work With 11.2.0.3 Oracle JVM Based On JDK5
(Doc ID 1555562.1)
Last updated on FEBRUARY 27, 2019
Applies to:
Oracle Spatial and Graph - Version 11.2.0.3 and laterInformation in this document applies to any platform.
Symptoms
Trying to use Jena API from code in java stored procedures in Oracle RDBMS 11.2.0.3
If using .Net as the application server plattform (not Java). Calling Java Stored Procedures from .Net is one way to use Jena library.
Sample code using the Jena Adapter version 11.2.0.3:
1) Load Jena 2.6.4 jars into Oracle using the loadjava tool;
2) Load Jena Adapter for Oracle "sdordfclient.jar" using the loadjava tool;
3) Stored procedure code:
public class OracleJenaAdapterTest {
public static void TestJenaOracleAdapter(String szJdbcURL, String szUser,
String szPasswd, String szModelName) throws SQLException {
Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
Model model = ModelOracleSem.createOracleSemModel(oracle, szModelName);
String sparqlQuery = "select * WHERE { ?s ?p ?o .} ";
Query query = QueryFactory.create(sparqlQuery);
QueryExecution qexec = QueryExecutionFactory.create(query, model);
ResultSet results = qexec.execSelect();
ResultSetFormatter.out(System.out, results, query);
model.close();
oracle.dispose();
}
}
4) Trying to load the following stored procedure into Oracle using loadjava:
loadjava -user TESTUSER/*****@DB -v -resolve OracleJenaAdapterTest.java
5) Result:
creating : source OracleJenaAdapterTest
loading : source OracleJenaAdapterTest
resolving: source OracleJenaAdapterTest
errors : source OracleJenaAdapterTest
ORA-29535: source requires recompilation
OracleJenaAdapterTest:23: cannot access oracle.spatial.rdf.client.jena.Oracle
bad class file: null
class file has wrong version 50.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
^
1 error
The following operations failed
source OracleJenaAdapterTest: resolution
exiting : Failures occurred during processing
Changes
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |
References |