4.3. Using DB2

  1. Install a DB2 database (tested with version 8.2).

  2. Create a database called opal2_db, and a user called opal_user with a password. Grant all permissions on opal2_db to the opal_user. Configure the database to accept remote JDBC connections (consult the database documentation for this).

  3. Edit the etc/hibernate-opal.cfg.xml configuration file and comment out the properties that are HSQL specific. In particular, the following five lines should be commented out as follows:

            <!-- Database connection settings for HSQL -->
    <!--         <property name="connection.driver_class">org.hsqldb.jdbcDriver</property> -->
    <!--         <property name="connection.url">jdbc:hsqldb:file:data/opaldb</property> -->
    <!--         <property name="connection.username">sa</property> -->
    <!--         <property name="connection.password"></property> -->
    <!--         <property name="dialect">org.hibernate.dialect.HSQLDialect</property> -->

  4. Uncomment the properties that are DB2 specific. In particular, uncomment the following five lines as follows:

            <!-- Database connection settings for DB2 -->
            <property name="connection.driver_class">com.ibm.db2.jcc.DB2Driver</property> 
            <property name="connection.url">jdbc:db2://localhost:60000/opaldb</property> 
            <property name="connection.username">opal_user</property> 
            <property name="connection.password">opal_passwd</property> 
            <property name="dialect">org.hibernate.dialect.DB2Dialect</property> 

    Note that you can change the property connection.url to point to a database that is running on another machine as long as it can accept JDBC connection from the machine running the Opal services. If the database is running on the same machine as the Opal server, there is no need to change the value of this property.

  5. Reinstall Opal by running the following command:

        ant install

  6. Restart Tomcat for the changes to take effect.