Liferay Portal Database Portal Properties

This article is intended to provide a list of all of the Liferay Portal Database properties that can be used to connect your portal to various databases. To use any of them, un-comment the block of code and paste it into your portal-ext.properties file.

For example, to enable MySQL, you should copy and paste the below into your portal-ext.properties file:

MySQL
    #
    #jdbc.default.driverClassName=com.mysql.jdbc.Driver
    #jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
    #jdbc.default.username=
    #jdbc.default.password=

Replacing lportal in jdbc.default.url with the name of your database and inserting the username and password of your intended database user in the appropriate properties.

Resolution

Portal Properties

JDBC
##

    #
    # Set the JNDI name to lookup the JDBC data source. If none is set,
    # then the portal will attempt to create the JDBC data source based on the
    # properties prefixed with "jdbc.default.".
    #
    #jdbc.default.jndi.name=jdbc/LiferayPool

    #
    # Set the properties used to create the JDBC data source. These properties
    # will only be read if the property "jdbc.default.jndi.name" is not set.
    #
    # The default settings are configured for an in-memory database called
    # Hypersonic that is not recommended for production use. Please change the
    # properties to use another database.
    #
    # Add dynamic-data-source-spring.xml to the property "spring.configs" to
    # configure the portal to use one database cluster for read calls and
    # another database cluster for write calls. The convention is to create a
    # set of properties prefixed with "jdbc.read." to handle read calls and
    # another set of properties prefixed with "jdbc.write." to handle write
    # calls. These data sources can also be created via JNDI by setting the
    # properties "jdbc.read.jndi.name" and "jdbc.write.jndi.name". Note that
    # these settings, though separate, are a copy of the default settings with
    # the newly overridden values.

DB2

DB2
    #
    #jdbc.default.driverClassName=com.ibm.db2.jcc.DB2Driver
    #jdbc.default.url=jdbc:db2://localhost:50000/lportal:deferPrepares=false;fullyMaterializeInputStreams=true;fullyMaterializeLobData=true;progresssiveLocators=2;progressiveStreaming=2;
    #jdbc.default.username=db2admin
    #jdbc.default.password=lportal

Derby

Derby
    #
    #jdbc.default.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
    #jdbc.default.url=jdbc:derby:lportal
    #jdbc.default.username=
    #jdbc.default.password=

Hypersonic

Hypersonic
    #
    jdbc.default.driverClassName=org.hsqldb.jdbcDriver
    jdbc.default.url=jdbc:hsqldb:${liferay.home}/data/hsql/lportal
    jdbc.default.username=sa
    jdbc.default.password=

Ingres

Ingres
    #
    #jdbc.default.driverClassName=com.ingres.jdbc.IngresDriver
    #jdbc.default.url=jdbc:ingres://localhost:II7/lportal
    #jdbc.default.username=
    #jdbc.default.password=

MySQL

MySQL
    #
    #jdbc.default.driverClassName=com.mysql.jdbc.Driver
    #jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
    #jdbc.default.username=
    #jdbc.default.password=

Oracle

Oracle
    #
    #jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver
    #jdbc.default.url=jdbc:oracle:thin:@localhost:1521:xe
    #jdbc.default.username=lportal
    #jdbc.default.password=lportal

P6Spy

P6Spy
    #
    #jdbc.default.driverClassName=com.p6spy.engine.spy.P6SpyDriver
    #jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
    #jdbc.default.username=
    #jdbc.default.password=

PostgreSQL

PostgreSQL
    #
    #jdbc.default.driverClassName=org.postgresql.Driver
    #jdbc.default.url=jdbc:postgresql://localhost:5432/lportal
    #jdbc.default.username=sa
    #jdbc.default.password=

SQL Server

SQL Server
   #
    #jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
    #jdbc.default.url=jdbc:jtds:sqlserver://localhost/lportal
    #jdbc.default.username=sa
    #jdbc.default.password=

Sybase

Sybase
    #
    #jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
    #jdbc.default.url=jdbc:jtds:sybase://localhost:5000/lportal
    #jdbc.default.username=sa
    #jdbc.default.password=

Additional Information

See the Compatibility Matrix page to see which Databases are supported with different versions of Liferay.

Was this article helpful?
0 out of 0 found this helpful