Recently, I had to configure LR to IBM's DB-2 Database.
I tried this on my windows machine. If you are installing on any other OS, you could use these steps as a guideline, the steps would be pretty similar though.
Here are the steps.
Step 1:
I downloaded DB-2 9.5 Express from here.
This is a trial version that is valid for 90 days.
Step 2:
Install DB2. It is pretty straight forward.
Step 3:
Open the DB2 Control Center.
Clik on "All Databases".
Click on Create New Database.
Enter the Database Name as lportal, and click on Finish.
Step 4:
Click on lportal in the "All Databases".
Click on User and Group Objects -> DB Users -> Add New User.
AFAIK, DB2 maps the OS users to the DB users. Not sure how to create new users in DB2.
So I created a OS user named lportal.
In the "Add New User" dialog, enter the user Name as lportal, and allocate all permissions.
Click on Apply and Ok.
To update the user password, in control center -> Tools -> Configuration Assistant -> Right Click on lportal -> Change Password -> Enter the userId, old and new password and click on "OK".
Step 5:
The next step is to place the DB2 driver classes in the app server path.
Copy the db2jcc.jar, db2jcc_license_cu.jar from <db2-install>IBM\SQLLIB\java and put them in <Glassfish>\domains\<ur domain>\lib directory if you are using Glassfish as the app server.
If you are using tomcat, then copy these 2 jars into <tomcat>\lib\ext directory.
Step 6:
For LR-5.2 and above, In WEB-INF\classes\portal-ext.properties, over ride the jdbc-default* properties, and give the appropriate values for DB2.
I gave the following properties
jdbc.default.driverClassName=com.ibm.db2.jcc.DB2Driver
jdbc.default.url=jdbc:db2:lportal
jdbc.default.username=lportal
jdbc.default.password=lportal
Enter the values as per your set up.
If you are using any version that is before 5.2, then you need to update the DB config in Root.xml (Tomcat) and domain.xml (for Glassfish).
Step 7:
In case of Glassfish, you have this additional step.
Access the admin console (localhost:4848 by default).
Click Configurations -> your_config -> JVM settings -> Path settings -> Native Library Path Suffix.
I added the following:
F:/PROGRA~1/IBM/SQLLIB/BIN;F:/PROGRA~1/IBM/SQLLIB/FUNCTION;F:/PROGRA~1/IBM/SQLLIB/SAMPLES/REPL
Add the values according to the path in your DB2 install.
Save this setting. GF saves this in your domain.xml.
This step is NOT eeded in case of Tomcat. When DB2 installs, it sets the above parameters as env variables.
Tomcat reads these env varialbes, but GF dosent.
If you dont do this in case of GF, you would java.lang.UnSatisfiedLink Error because GF cant find the dll files.
Thanks Sandeep, for your guidance on this step
. I was struggling on this step, when he came over to my desk and discovered what the problem was, and suggested this solution.
Step 8:
Restart app server,
You would see that when the app server starts, the tables are created.
Goto DB2 control center, and verify that the tables are created.
Thats it !!
Pls leave ur comments on this page.


