Liferay DXP 7.2 Database Portal Properties

This article is intended to provide a list of all the Liferay DXP 7.2 properties that can be used to connect the database of your choice to your Liferay DXP 7.2 installation. To use any of them, uncomment the block of code you need, 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:

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

Replace the connection settings in jdbc.default.url with the name of your database replacing lportal, 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.".
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_JNDI_PERIOD_NAME
#
#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.
#
# To configure the portal to use one data source for read calls and another
# data source for read-write calls, follow these steps:
#
# 1. Similar to the settings prefixed with "jdbc.default.", create a set of
# properties prefixed with "jdbc.read." to handle read calls and another
# set of properties prefixed with "jdbc.write." to handle read-write calls.
#
# 2. Add "jdbc.read.jndi.name" and "jdbc.write.jndi.name" properties that
# specify the data source JNDI names.
#
# 3. Add dynamic-data-source-spring.xml to the property
# "spring.configs" and dynamic-data-source-infrastructure-spring.xml to the
# property "spring.infrastructure.configs"
#

DB2

 #
# DB2
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME
#
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

Hypersonic

 #
# Hypersonic
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME
#
jdbc.default.driverClassName=org.hsqldb.jdbc.JDBCDriver
jdbc.default.url=jdbc:hsqldb:${liferay.home}/data/hypersonic/lportal;hsqldb.write_delay=false
jdbc.default.username=sa
jdbc.default.password=

MariaDB

 #
# MariaDB
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME
#
jdbc.default.driverClassName=org.mariadb.jdbc.Driver
jdbc.default.url=jdbc:mariadb://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=

MySQL

 #
# MySQL
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME
#
jdbc.default.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&serverTimezone=GMT&useFastDateParsing=false&useUnicode=true
jdbc.default.username=
jdbc.default.password=

Oracle

 #
# Oracle
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME
#
jdbc.default.driverClassName=oracle.jdbc.OracleDriver
jdbc.default.url=jdbc:oracle:thin:@localhost:1521:xe
jdbc.default.username=lportal
jdbc.default.password=lportal

P6Spy

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

PostgreSQL

 #
# PostgreSQL
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME
#
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
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME
#
jdbc.default.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.default.url=jdbc:sqlserver://localhost;databaseName=lportal
jdbc.default.username=sa
jdbc.default.password=

Sybase

 #
# Sybase
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME
#
jdbc.default.driverClassName=com.sybase.jdbc4.jdbc.SybDriver
jdbc.default.url=jdbc:sybase:Tds:localhost:5000/lportal
jdbc.default.username=sa
jdbc.default.password=

 

Additional Information

#
# Liferay can use C3PO, DBCP, HikariCP, or Tomcat for connection pooling.
# See com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean for the actual
# implementation. It is important to understand the strengths and weaknesses
# of each provider so that you can choose the best one that fits your
# deployment scenario. Provider specific properties can also be passed along
# directly to the provider. For example, the property
# "jdbc.default.acquireIncrement" is read by C3PO, and the property
# "jdbc.default.maxActive" is read by DBCP.
#
# The default provider is HikariCP.
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_LIFERAY_PERIOD_POOL_PERIOD_PROVIDER
#
#jdbc.default.liferay.pool.provider=c3po
#jdbc.default.liferay.pool.provider=dbcp
jdbc.default.liferay.pool.provider=hikaricp
#jdbc.default.liferay.pool.provider=tomcat

#
# The following properties will be read by C3PO if Liferay is configured to
# use C3PO in the property "jdbc.default.liferay.pool.provider". See
# http://www.mchange.com/projects/c3p0/index.html#configuration for a list
# of additional fields used by C3PO for configuring database connections.
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_ACQUIRE_UPPERCASEI_NCREMENT
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_ACQUIRE_UPPERCASER_ETRY_UPPERCASEA_TTEMPTS
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_ACQUIRE_UPPERCASER_ETRY_UPPERCASED_ELAY
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_CONNECTION_UPPERCASEC_USTOMIZER_UPPERCASEC_LASS_UPPERCASEN_AME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_IDLE_UPPERCASEC_ONNECTION_UPPERCASET_EST_UPPERCASEP_ERIOD
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_INITIAL_UPPERCASEP_OOL_UPPERCASES_IZE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_MAX_UPPERCASEI_DLE_UPPERCASET_IME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_MAX_UPPERCASEP_OOL_UPPERCASES_IZE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_MIN_UPPERCASEP_OOL_UPPERCASES_IZE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_NUM_UPPERCASEH_ELPER_UPPERCASET_HREADS
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_TRANSACTION_UPPERCASEI_SOLATION
#
jdbc.default.acquireIncrement=5
jdbc.default.acquireRetryAttempts=3
jdbc.default.acquireRetryDelay=1000
jdbc.default.connectionCustomizerClassName=com.liferay.portal.dao.jdbc.pool.c3p0.PortalConnectionCustomizer
jdbc.default.idleConnectionTestPeriod=60
jdbc.default.initialPoolSize=10
jdbc.default.maxIdleTime=3600
jdbc.default.maxPoolSize=100
jdbc.default.minPoolSize=10
jdbc.default.numHelperThreads=10
#jdbc.default.transactionIsolation=1

#
# The following properties will be read by HikariCP if Liferay is configured
# to use HikariCP in the property "jdbc.default.liferay.pool.provider". See
# https://github.com/brettwooldridge/HikariCP for a list of additional
# fields used by HikariCP for configuring database connections.
#
# HikariCP recommends to also tune database settings. See
# https://github.com/brettwooldridge/HikariCP/wiki for additional setting
# details for database.
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_AUTO_UPPERCASEC_OMMIT
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_CONNECTION_UPPERCASET_EST_UPPERCASEQ_UERY
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_CONNECTION_UPPERCASET_IMEOUT
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_IDLE_UPPERCASET_IMEOUT
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_INITIALIZATION_UPPERCASEF_AIL_UPPERCASEF_AST
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_MAXIMUM_UPPERCASEP_OOL_UPPERCASES_IZE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_MAX_UPPERCASEL_IFETIME
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_MINIMUM_UPPERCASEI_DLE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_REGISTER_UPPERCASEM_BEANS
#
#jdbc.default.autoCommit=true
#jdbc.default.connectionTestQuery=SELECT releaseId FROM Release_
jdbc.default.connectionTimeout=30000
jdbc.default.idleTimeout=600000
#jdbc.default.initializationFailFast=false
jdbc.default.maximumPoolSize=100
jdbc.default.maxLifetime=0
jdbc.default.minimumIdle=10
jdbc.default.registerMbeans=true

#
# The following properties will be read by both DBCP and Tomcat JDBC
# Connection Pool if Liferay is configured to use DBCP or Tomcat JDBC
# Connection Pool in the property "jdbc.default.liferay.pool.provider". See
# http://commons.apache.org/dbcp/configuration.html and
# http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html for a list of
# additional fields used by DBCP or Tomcat JDBC Connection Pool for
# configuring database connections.
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DEFAULT_UPPERCASET_RANSACTION_UPPERCASEI_SOLATION
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_LOG_UPPERCASEA_BANDONED
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_MAX_UPPERCASEA_CTIVE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_MIN_UPPERCASEI_DLE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_REMOVE_UPPERCASEA_BANDONED_UPPERCASET_IMEOUT
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_TEST_UPPERCASEW_HILE_UPPERCASEI_DLE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_TIME_UPPERCASEB_ETWEEN_UPPERCASEE_VICTION_UPPERCASER_UNS_UPPERCASEM_ILLIS
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_VALIDATION_UPPERCASEQ_UERY
#
#jdbc.default.defaultTransactionIsolation=READ_UNCOMMITTED
#jdbc.default.logAbandoned=true
jdbc.default.maxActive=100
jdbc.default.minIdle=10
#jdbc.default.removeAbandonedTimeout=3600
jdbc.default.testWhileIdle=true
jdbc.default.timeBetweenEvictionRunsMillis=30000
jdbc.default.validationQuery=SELECT releaseId FROM Release_

#
# The following properties will be read by Tomcat JDBC Connection Pool if
# Liferay is configured to use Tomcat JDBC Connection Pool in the property
# "jdbc.default.liferay.pool.provider". See
# http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html for a list of
# additional fields used by Tomcat JDBC Connection Pool for configuring
# database connections.
#
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_FAIR_UPPERCASEQ_UEUE
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_JDBC_UPPERCASEI_NTERCEPTORS
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_JMX_UPPERCASEE_NABLED
# Env: LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USE_UPPERCASEE_QUALS
#
jdbc.default.jdbcInterceptors=org.apache.tomcat.jdbc.pool.interceptor.ConnectionState
jdbc.default.jmxEnabled=true
jdbc.default.fairQueue=true
jdbc.default.useEquals=false
Este artigo foi útil?
Utilizadores que acharam útil: 0 de 0