Legacy Knowledge Base
Published Sep. 10, 2025

Setting Up Liferay Portal on a DB2 Database

Written By

Justin Choi

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

This article is a legacy article. It applies to previous versions of the Liferay product. While the article is no longer maintained, the information may still be applicable.

This article outlines steps on how to setup a DB2 connection with Liferay Portal. This article use properties set in the portal-ext.properties file, and not through the use of JNDI.

Resolution

  1. In the DB2 Control Center, create the appropriate database name, for example "lrdb". If using Portal 6.1.x, the page size of the created database should be 8k. The default value is 4k, and will not work for Liferay Portal 6.1.x
  2. Grant the appropriate permissions to the database user.
  3. Place the following properties in to portal-ext.properties file:
    jdbc.default.driverClassName=com.ibm.db2.jcc.DB2Driver
    
    jdbc.default.url=jdbc:db2://localhost:50000/lrdb:deferPrepares=false;fullyMaterializeInputStreams=true;fullyMaterializeLobData=true;progresssiveLocators=2;progressiveStreaming=2;
    
    jdbc.default.username=db2admin
    
    jdbc.default.password=lportal
    		
    
    custom.sql.function.isnull=CAST(? AS VARCHAR(32672)) IS NULL
    
    custom.sql.function.isnotnull=CAST(? AS VARCHAR(32672)) IS NOT NULL
    	
  4. Place the necessary DB2 driver JARs (db2jcc.jar, db2jcc_license_cu.jar) in the dependencies folder.
  5. Start up Liferay Portal.

Additional Information

The big difference with DB2 over other databases is the need for the custom.sql.function properties in portal-ext.properties file.

Did this article resolve your issue ?

Legacy Knowledge Base