Click for other Manual Versions

uPortal 4.0 Manual

Versions Compared

Key

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

Overview

DB2 is a commercial database from IBM. The DB2 database software is availble from IBM at:
http://www.ibm.com/software/data/db2/

Step 1

...

: Obtain the Driver

Since the DB2 JDBC driver is not available in the central Maven repository, it must be placed into the local repository of each machine on which you wish to build uPortal.

...

A JDBC DB2 driver is included in the DB2 software in the java subdirectory after DB2 installation has been performed. To install the JAR into your local maven repository, use the following command:

No Formatcode

mvn install:install-file -DgroupId=com.ibm.db2 -DartifactId=db2-jdbc -Dversion=<version> -Dpackaging=jar -DgeneratePom=true -Dfile=db2java.zip.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.

2. JAR Configuration

...

Step 2: Add the Dependency

From the uPortal source directory, open uPortal-4.x.x/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>

Modify this to use the DB2 driver, 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.ibm.db2</jdbc.groupId>
    <jdbc.artifactId>db2-jdbc</jdbc.artifactId>
    <jdbc.version>version</jdbc.version>

Step 3

...

Edit uPortal/uportal-war/src/main/resources/properties/rdbm.properties by adding the following information for MSSQL, modifying the url, username and password as appropriate:

...

: Configure the Database Filter     

     1. In the filters folder, locate the default local.properties file under uPortal-4.x.x/filters/local.properties and configure the Database Connection Settings

Code Block
titleuPortal/filters/local.properties
# HSQL Configuration
environment.build.hsql.port=8887

# Database Connection Settings 
environment.build.hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver
environment.build.hibernate.connection.url=jdbc:db2:uPortal3Db
environment.build.hibernate.connection.username=testsa
environment.build.hibernate.connection.password=mypass
environment.build.hibernate.dialect=cirrusorg.hibernate.sqldialect.DB2Dialect


Step 4

...

: Test the Configuration

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

Code Block

ant dbtest

Then, following  

Step 5: Build and Deploy 

Following a successful test, you can execute

...

Code Block

ant initportal

...

the command below to build the database tables and copy files to your servlet container. 

Warning
iconfalse

Note: Executing the command "ant clean initportal" will drop and recreate the database tables and all existing data will be lost. This will result in a clean uPortal database structure. If you want to keep the contents of your existing database, use "ant clean deploy-war"

Code Block
ant clean initportal

Step 6: Restart Tomcat

 

 

Issues and Known Bugs

Some people have encountered problems with database drivers 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.

...