Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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)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 determine if you have the Oracle client and Oracle JDBC drivers installed on your local machine. If Oracle is installed on your local machine it will be located at $ORACLE_HOME. Try to locate the driver using the following command:

No Format

ls $ORACLE_HOME/lib/ 

If you cannot locate it 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=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -DgeneratePom=true -Dfile=ojdbc14-10.2.0.3.0.jar

The -DgroupId, -DartifactId and -Dversion specified in this command are up to you but they should match the JAR vendor, name and version to avoid confusion down the road.
The -Dfile is the Oracel JDBC driver. You should include the working directory path in the event the driver is not in the directory you are running maven from.

Opening /uPortal/pom.xml there is a section about 92 lines down that reads:

Code Block
xml
xml

<!-- The JDBC Driver used by uPortal -->
        <jdbc.groupId>hsqldb</jdbc.groupId>
        <jdbc.artifactId>hsqldb</jdbc.artifactId>
        <jdbc.version>${hsqldb.version}</jdbc.version>

We will add the Oracle driver here using the group, artifact and version information from the mvn install:install-file command above.

Code Block
xml
xml

<!-- The JDBC Driver used by uPortal -->
        <jdbc.groupId>com.oracle</jdbc.groupId>
        <jdbc.artifactId>ojdbc14</jdbc.artifactId>
        <jdbc.version>10.2.0.3.0</jdbc.version>

See Issues section about possible issues using this driver.

...

JDBC 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 exampleEdit /uPortal/uportal-impl/src/main/resources/properties/rdbm.properties and uncomment the lines for Oracle Modify the URL, username and password as appropriate:

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

Testing The Configuration

Running the dbtest ant target will tell you if you have configured the database connection properly.

Code Block

ant dbtest

If it works correct you should see something like:

Code Block

[java]     Connected jdbcUrl=To: jdbc:oracle:thin:@localhost@yourserver:1521:uportal
      jdbcUser=test[java]     Supports:
     [java]         Outer Joins:          true
     [java]         Transactions:         true
     [java]         {ts metasyntax:       true
     [java]        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> TO_DATE():           <db-name>Oracle</db-name> false

    <!-- Line break has to be here --> [java] Database name:    'Oracle'
      <db-version>Oracle8 Enterprise Edition[java] Database version: 'Oracle Database 11g Release 811.1.0.60.2.0 - Production'
     [java] Driver name:      PL/SQL Release 8'Oracle JDBC driver'
     [java] Driver version:   '10.2.0.63.2.0'
   - Production</db-version>
   [java] Driver class:     <driver-name>Oracle'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.

Code Block

<!-- JDBC Properties -->
    <driver>oracle.jdbc.driver.OracleDriver</driver>
    <url>jdbc:oracle:thin:@localhost:1521:uportal</url>
    <logonid>test</logonid>
    <logonpassword>mypass</logonpassword>,
    <uidquery>SELECT FIRST_NAME||' '||LAST_NAME AS FIRST_LAST,
    FIRST_NAME, LAST_NAME, EMAIL FROM UP_PERSON_DIR WHERE USER_NAME=?></uidquery>

...

driver'
     [java] Connection URL:   'jdbc:oracle:thin:@yourserver:1521:uportal'
     [java] User:             'USERNAME'

     [java] Type Mappings: [Type[genericType=TIMESTAMP,local=DATE]]

     [java] supportsANSI92EntryLevelSQL: true
     [java] supportsANSI92FullSQL:       false
     [java] supportsCoreSQLGrammar:     true
     [java] supportsExtendedSQLGrammar: true

     [java] supportsTransactions:         true
     [java] supportsMultipleTransactions: true
     [java] supportsOpenCursorsAcrossCommit:      false
     [java] supportsOpenCursorsAcrossRollback:    false
     [java] supportsOpenStatementsAcrossCommit:   false
     [java] supportsOpenStatementsAcrossRollback: false

     [java] supportsStoredProcedures:     true
     [java] supportsOuterJoins:           true
     [java] supportsFullOuterJoins:       true
     [java] supportsLimitedOuterJoins:    true
     [java] supportsBatchUpdates:         true
     [java] supportsColumnAliasing:       true
     [java] supportsExpressionsInOrderBy: true
     [java] supportsOrderByUnrelated:     true
     [java] supportsPositionedDelete:     false
     [java] supportsSelectForUpdate:      true
     [java] supportsUnion:                true
     [java] supportsUnionAll:             true

     [java] getMaxColumnNameLength: 30
     [java] getMaxColumnsInIndex:   32
     [java] getMaxColumnsInOrderBy: 0
     [java] getMaxColumnsInSelect:  0
     [java] getMaxColumnsInTable:   1000
     [java] getMaxConnections:      0
     [java] getMaxCursorNameLength: 0
     [java] getMaxIndexLength:      0
     [java] getMaxRowSize:          2000
     [java] getMaxStatements:       0
     [java] getMaxTableNameLength:  30
     [java] getMaxTablesInSelect:   0
     [java] getMaxUserNameLength:   30
     [java] getSearchStringEscape:  //
     [java] getStringFunctions:     ASCII,CHAR,CONCAT,LCASE,LENGTH,LTRIM,REPLACE,RTRIM,SOUNDEX,SUBSTRING,UCASE
     [java] getSystemFunctions:     USER
     [java] getTimeDateFunctions:   HOUR,MINUTE,SECOND,MONTH,YEAR

     [java] Table Types: SYNONYM,TABLE,VIEW
     [java] SQL Types:   INTERVALDS,INTERVALYM,TIMESTAMP WITH LOCAL TIME ZONE,TIMESTAMP WITH TIME ZONE,
NUMBER,NUMBER,NUMBER,LONG RAW,RAW,LONG,CHAR,NUMBER,NUMBER,NUMBER,FLOAT,REAL,VARCHAR2,DATE,DATE,
TIMESTAMP,STRUCT,ARRAY,BLOB,CLOB,REF

BUILD SUCCESSFUL

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
xml
xml

<db-type-mapping>
    <db-name>Oracle</db-name>
    <db-version>Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit ProductionWith the Partitioning, OLAP and Data Mining options</db-version>
    <driver-name>Oracle JDBC driver</driver-name>
    <driver-version>10.2.0.3.0</driver-version>
    <type><generic>TIMESTAMP</generic><local>DATE</local></type>
    <!-- map more types here -->
  </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.

Loading the Database

Tip
titleDatabase Privileges

uPortal 3 requires CREATE SEQUENCE privileges, previous versions of uPortal did not.

Loading the database requires a couple of steps

...