Setting Up Liferay Portal on a DB2 Database

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 file, and not through the use of JNDI.


  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 file:
    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 file.

0 人中有 0 人觉得有帮助