Follow these instructions to configure your Liferay portal with DB2 SGBD :
- Downloading the jdbc Driver
To download the DB2 jdbc Driver, follow these instructions :
- Go to the official IBM site
- Choose the appropriate driver version according to your DB2 Version. I’m using DB2 10.5, so the appropriate JDBC Driver is 3.6646. Click on the appropriate version
- On the next window, select the IBM Data Server Driver for JDBC and click on “Continue”
- If you don’t have an IBM Identity, you must sign up
- At the end of the process, you must have an archive named v**.****_jdbc_sqlj.tar.gz. Download it
- Unzip the gz archive, you will have another archive called v**.****_jdbc_sqlj.tar.
- Unzip the tar archive, you will have jdbc_sqlj folder under which you have another archive called db2_db2driver_for_jdbc_sqlj.zip
- Unzip the db2_db2driver_for_jdbc_sqlj.zip (the last unzipping, i promise)
- Copy the db2jcc.jar and past it under $TOMCAT_HOME/lib/ext
- Creating the blank database
Create now the blank database. Let’s consider that the created database is “lportal”. Below the command to do it :
db2 => create database lportal;
- Updating portal-ext.properties
Open your portal-ext.properties file and past the following lines :
Set the correct username and password to connect to your database.
The portal-ext.properties is located in the same folder as your $TOMCAT_HOME. If it doesn’t exist, create it.
- Check the configuration
During the server start, you can verify that Liferay started with the correct dialect (DB2) by looking for the following line in your server log console/file:
14:57:09,239 INFO [localhost-startStop-1][DialectDetector:71] Determine dialect for DB2/NT64 10
14:57:09,302 INFO [localhost-startStop-1][DialectDetector:136] Found dialect com.liferay.portal.dao.orm.hibernate.DB2Dialect
If you go back to your database, you will see that it’s now populated by about 180 data tables that Liferay created on startup.
If you already configured your portal with hsql and want to re-configured it with the DB2 Database and add samples data, open portal-setup-wizard.properties file located in the same folder as portal-ext.properties. Set the setup.wizard.enabled to true and restart your server.