Liferay Portal 6.1 - User Guide
| Download PDF | Purchase Print Book |
Liferay provides a rich store of resources and knowledge to help our community better use and work with our technology.
| Download PDF | Purchase Print Book |
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..
Example:
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
Examples:
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
Examples:
jdbc.default.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
jdbc.default.url=jdbc:derby:lportal
jdbc.default.username=
jdbc.default.password=
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
Examples:
jdbc.default.driverClassName=com.ingres.jdbc.IngresDriver
jdbc.default.url=jdbc:ingres://localhost:II7/lportal
jdbc.default.username=
jdbc.default.password=
MySQL
Examples:
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
Examples:
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
Examples:
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
Examples:
jdbc.default.driverClassName=org.postgresql.Driver
jdbc.default.url=jdbc:postgresql://localhost:5432/lportal
jdbc.default.username=sa
jdbc.default.password=
SQL Server
Examples:
jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
jdbc.default.url=jdbc:jtds:sqlserver://localhost/lportal
jdbc.default.username=sa
jdbc.default.password=
Sybase
Examples:
jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
jdbc.default.url=jdbc:jtds:sybase://localhost:5000/lportal
jdbc.default.username=sa
jdbc.default.password=
Liferay can use C3PO, DBCP, or Primrose 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, the property jdbc.default.maxActive is read by DBCP and the property jdbc.default.base is read by Primrose.
The default provider is C3PO.
Examples:
jdbc.default.liferay.pool.provider=c3po
jdbc.default.liferay.pool.provider=dbcp
jdbc.default.liferay.pool.provider=primrose
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.
Examples:
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.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 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.
jdbc.default.defaultTransactionIsolation=READ_UNCOMMITTED
jdbc.default.maxActive=100
jdbc.default.minIdle=10
jdbc.default.removeAbandonedTimeout=3600
The following properties will be read by Primrose if Liferay is configured to use Primrose in the property jdbc.default.liferay.pool.provider. See http://www.primrose.org.uk/primrose3/primroseConfig.html for a list of additional fields used by Primrose for configuring database connections.
Examples:
jdbc.default.base=100
jdbc.default.connectionTransactionIsolation=TRANSACTION_READ_UNCOMMITTED
jdbc.default.idleTime=1800000
jdbc.default.numberOfConnectionsToInitializeWith=10
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.
jdbc.default.jdbcInterceptors=org.apache.tomcat.jdbc.pool.interceptor.ConnectionState
jdbc.default.jmxEnabled=true
jdbc.default.fairQueue=true
jdbc.default.timeBetweenEvictionRunsMillis=30000
jdbc.default.useEquals=false