Oracle is one of the leading, commercially-available SQL relational database management systems. It is available in a variety of configurations from small personal versions to fault-tolerant, enterprise-class versions. It runs on a variety of hardware/operating system platforms.
As Oracle is commercially-available software, we cannot provide generic download instructions. We assume that Jena users wishing to use Oracle have access to an existing Oracle installation or access to the software. Below we list some assumptions and post-installation instructions for using Oracle with Jena.
Jena2 can be run with Oracle XE, as well as the full commercial versions, on both WindowsXP and Linux.
Jena2 can be run with both thin and thick JDBC drivers.
Currently, some configuration is necessary to work with all driver choices.
Jena supports both memory models and database models. In general, a Jena program may use both types of models identically. However, there are some differences in how the models are created. Creating a memory model can be done with a single Jena call. Creating a database model, or opening a previously created one, requires several steps as as follows.
Important
Persistent models are created in the same way for any database system:
- Load the JDBC driver. This enables the Jena program to communicate with the database instance.
- Create a database connection. This creates a Java object for a database connection.
- Create a ModelMaker for the database
- Create a Model for existing or new data.
These steps are illustrated in the following Java code.
String className = "oracle.jdbc.driver.OracleDriver"; // path of driver class Class.forName (className); // Load the Driver String DB_URL = "jdbc:oracle:oci:@"; // URL of database String DB_USER = "????"; // database user id String DB_PASSWD = "????"; // database password String DB = "Oracle"; // database type // Create database connection IDBConnection conn = new DBConnection ( DB_URL, DB_USER, DB_PASSWD, DB ); ModelMaker maker = ModelFactory.createModelRDBMaker(conn) ; // create or open the default model Model model = maker.createModel(); // Close the database connection conn.close();
Oracle 10, including Oracle 10 XE, does not present these issues.