...
Oracle is a commercial database available from http://www.oracle.com.
The Oracle FAQ is available from http://www.orafaq.com.
Obtaining a Driver
A Since the Oracle JDBC driver is also available through http://www.oracle.com. Versions for Oracle 8i and Oracle 9i are available. The driver downloads as a single "zip" file (for example, classes12.zip). The file should be stored in a directory where it will be accessible from the uPortal build environment (for example /usr/local/java/oracle/lib/classes12.zip)
See Issues section about possible issues using this driver.
Properties Configuration
The uPortal build.properties will need to be modifed. Find the property called jdbcDriver and change it to point to the Oracle zip/jar file, for example:
Code Block |
---|
jdbcDriver.jar=/usr/local/java/lib/classes12.zip
|
The uPortal rdbm.properties file (in the properties/db directory) will need to modified to specify the driver properties. First, comment out the property definitions which are currently defined (most likely, for HypersonicSQL). The rdbm.properties file contains several sample entries. Uncomment the lines for the Oracle database and make whatever changes necessary to match your local database installation, For example:
Code Block |
---|
##### Oracle - example
jdbcDriver=oracle.jdbc.driver.OracleDriver
jdbcUrl=jdbc:oracle:thin:@localhost:1521:uportal
jdbcUser=test
jdbcPassword=mypass
|
The dbloader.xml properties file (also in the properties/db directory) may also need to be modified. This file is used by the DbLoader tool to create the uPortal database tables and populate the database. It contains several sample entries which create db-type-mappings for different databases. Find the tags for an Oracle database and modify the db-version, driver-name, and driver-version as necessary. For example:
Code Block |
---|
<db-type-mapping>
<db-name>Oracle</db-name>
<!-- Line break has to be here -->
<db-version>Oracle8 Enterprise Edition Release 8.0.6.2.0 - Production
PL/SQL Release 8.0.6.2.0 - Production</db-version>
<driver-name>Oracle JDBC driver</driver-name>
<driver-version>8.1.6.0.0</driver-version>
<type><generic>TIMESTAMP</generic><local>DATE</local></type>
<!-- map more types here -->
</db-type-mapping>
|
The PersonDirs.xml file (also in the properties directory) may need to be modified; This file is used if the database is to be used to provide user directory information.
...
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:
No Format |
---|
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:
Code Block | ||||
---|---|---|---|---|
| ||||
<!-- ***** 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.
Code Block | ||||
---|---|---|---|---|
| ||||
<!-- ***** 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:
Code Block |
---|
##### 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:
Code Block |
---|
ant dbtest
|
If it works correct you should see something like
Code Block |
---|
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:
Code Block |
---|
<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
Code Block |
---|
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
...