« Zurück zu Database...

Database Portal Properties

Introduction #

This page contains a bunch of portal properties that are by default either commented out or set to some default value. To use any of them, uncomment 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:

    #
    # 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=

This page has similar settings for all the databases that Liferay Portal supports. These properties will work in Liferay versions 5.2 and above.

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

DerbyDB #

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

Hypersonic #

This is the default database that comes with the Liferay Bundle. DO NOT USE HYPERSONIC IN PRODUCTION.

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

IngresDB #

    #
    # 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=
    #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=

Connection Pooling #

    #
    # 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.
    #
    jdbc.default.liferay.pool.provider=c3po
    #jdbc.default.liferay.pool.provider=dbcp
    #jdbc.default.liferay.pool.provider=primrose

    #
    # 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.
    #
    jdbc.default.acquireIncrement=5
    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=3
    #jdbc.default.transactionIsolation=1

    #
    # The following properties will be read by DBCP if Liferay is configured to
    # use DBCP in the property "jdbc.default.liferay.pool.provider". See
    # http://commons.apache.org/dbcp/configuration.html for a list of additional
    # fields used by DBCP 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.
    #
    jdbc.default.base=100
    #jdbc.default.connectionTransactionIsolation=TRANSACTION_READ_UNCOMMITTED
    jdbc.default.idleTime=1800000
    jdbc.default.numberOfConnectionsToInitializeWith=10

Custom SQL #

##
## Custom SQL
##

    #
    # Input a list of comma delimited custom SQL configurations.
    #
    custom.sql.configs=custom-sql/default.xml

    #
    # Some databases do not recognize a NULL IS NULL check. Set the
    # "custom.sql.function.isnull" and "custom.sql.function.isnotnull"
    # properties for your specific database.
    #
    # There is no need to manually set these properties because
    # com.liferay.portal.spring.PortalHibernateConfiguration already sets it.
    # However, these properties are available so that you can see how you can
    # override it for a database that PortalHibernateConfiguration does not yet
    # know how to auto configure.
    #

    #
    # DB2
    #
    #custom.sql.function.isnull=CAST(? AS VARCHAR(32672)) IS NULL
    #custom.sql.function.isnotnull=CAST(? AS VARCHAR(32672)) IS NOT NULL

    #
    # MySQL (for testing only)
    #
    #custom.sql.function.isnull=IFNULL(?, '1') = '1'
    #custom.sql.function.isnotnull=IFNULL(?, '1') = '0'

    #
    # Sybase
    #
    #custom.sql.function.isnull=ISNULL(CONVERT(VARCHAR,?), '1') = '1'
    #custom.sql.function.isnotnull=ISNULL(CONVERT(VARCHAR,?), '1') = '0'

MySQl Engine #

##
## Database
##

    #
    # Specify any database vendor specific settings.
    #

    #
    # MySQL
    #

    #
    # Set the MySQL engine type. InnoDB is the recommended engine because it
    # provides transactional integrity.
    #
    database.mysql.engine=InnoDB
0 Anhänge
90450 Angesehen
Durchschnitt (2 Stimmen)
Die durchschnittliche Bewertung ist 5.0 von max. 5 Sternen.
Kommentare
Antworten im Thread Autor Datum
What are the properties for DB Sharding can go... Raja Nagendra Kumar 7. Juni 2012 22:10

What are the properties for DB Sharding can go here, basically if each portal instance how does DB get impacted

1. Is it possible to create a new database for each portal instance (data is completely isolated for each tenant for security reasons) - I think as of 6.1, this is still not supported
2. is webid treated as differentor and hence data related to all tenants is in just one database differentiated through tenant id (webid)
Gepostet am 07.06.12 22:10.