Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

About Oracle

Oracle is a commercial database available from http://www.oracle.com.
The Oracle FAQ is available from http://www.orafaq.com.

Obtaining a Driver

Since the Oracle JDBC driver is not available in the central Maven repository it must be placed into the local repository on each machine you wish to build uPortal on. An alternative to installing the JAR on each machine you can setup a maven repository for use by multiple machines.

The first step is to download the correct Oracle JDBC driver for your database. Once you have the jar it needs to be installed into your local maven repository using the following command:

mvn install:install-file -DgroupId= -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -DgeneratePom=true -Dfile=ojdbc14-10.2.0.3.0.jar

The groupId, artifactId and version specified in this command are up to you but they should match the JAR vendor, name and version to avoid confusion down the road.

Opening /uPortal/uportal-impl/pom.xml there is a section about 20 lines down that reads:

<!-- ***** Portal JDBC Driver *****
 | Add your JDBC Driver dependency here. If you are not using hsqldb you must change the scope
 | to test instead of just removing it as the driver is required for unit tests. 
 +-->
<dependency>
    <groupId>hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>${hsqldb.version}</version>
    <scope>compile</scope>
</dependency>

We will add the Oracle driver here using the group, artifact and version information from the mvn install:install-file command above and do as the comment says and change the <scope> tag of the hsqldb driver to test.

<!-- ***** Portal JDBC Driver *****
 | Add your JDBC Driver dependency here. If you are not using hsqldb you must change the scope
 | to test instead of just removing it as the driver is required for unit tests. 
 +-->
<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.3.0</version>
</dependency>

<dependency>
    <groupId>hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>${hsqldb.version}</version>
    <scope>test</scope>
</dependency>

See Issues section about possible issues using this driver.

JDBC Configuration

Edit /uPortal/uportal-impl/src/main/resources/properties/rdbm.properties and uncommment the lines for Oracle Modify the URL, username and password as appropriate:

##### Oracle 10g - example
hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
hibernate.connection.url=jdbc:oracle:thin:@my.school.edu:1521:PROJECTS
hibernate.connection.username=test
hibernate.connection.password=mypass
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect

Testing The Configuration

Start Postgres and then in your portal development directory, issue the command:

ant dbtest

If it works correct you should see something like

TODO

Edit /uPortal/uportal-impl/src/main/resources/properties/db/dbloader.xml and verify that there is an entry just like the database version you displayed in the last step:

  <db-type-mapping>
    <db-name>PostgreSQL</db-name>
    <db-version>7.4.5</db-version>
    <driver-name>PostgreSQL Native Driver</driver-name>
    <driver-version>PostgreSQL 7.4.5 JDBC3 with SSL (build 215)</driver-version>
    <type><generic>LONGVARCHAR</generic><local>TEXT</local></type>
    <type><generic>VARCHAR</generic><local>VARCHAR</local></type>
    <type><generic>LONGVARBINARY</generic><local>BYTEA</local></type>
    <type><generic>VARBINARY</generic><local>BYTEA</local></type>
    <type><generic>BLOB</generic><local>OID</local></type>
  </db-type-mapping>

If there is not an exact match, then add it.

Execute "ant initportal" to build the database tables and copy files to your servlet container

Start your servlet container.

If you upgrade Postgres, you should update the referenced JAR in uportal-impl/pom.xml and update entries in dbloader.xml.

Loading the Database

Loading the database requires a couple of steps

  • Create the database: Refer to the Oracle database documentation for instructions regarding how to create an Oracle database instances. The database name (or in this case, the Oracle SID), port number, and driver information must reflect what was defined in the rdbm.properties file
  • Create the tables and populate the database: From the uPortal build directory, run "ant db" to execute the ant target which loads the database. The ant target uses the Dbloader tool.

Additional Notes

Issues and Known Bugs

Some people have encountered problems with the Oracle JDBC driver with certain web application environments if the classes zip file is used as-is with the .zip file extension. Simply renaming the file to a .jar file seems to fix the problem. Alternatively, unzipping the classes file into a directory structure, then using the jar command to repackage the classes into a jar file works as well.

  • No labels