My Oracle Support Banner

Jena Adapter Rebuild To Work With Oracle JVM Based On JDK5 (Doc ID 1555562.1)

Last updated on FEBRUARY 27, 2019

Applies to:

Oracle Spatial and Graph - Version and later
Information in this document applies to any platform.


Trying to use Jena API from code in java stored procedures in Oracle RDBMS

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
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);


4) Trying to load the following stored procedure into Oracle using loadjava:
loadjava -user TESTUSER/*****@DB -v -resolve

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




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

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.