Abstract
Configuration document for Storage
Table of Contents
MMBaseRoot module (modules/mmbaseroot.xml). Basic configuration, selecting storagemanager or datasource.
JDBC module (modules/jdbc.xml). Configuration of the MMBase-provided JDBC interface.
Database resource (Attributes). Attributes affect the behavior of the database by specifying additional information such as the path to store blobs on file
Database resource (Options). Options affect the behavior of the database by turning features on or off, such as whether to create compound indexes.
Database resource (Schemes). Schemes define templates for SQL statements (or parts of SQL statements), such as the CREATE TABLE statement.
<?xml version="1.0"?> <!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://www.orionserver.com/dtds/data-sources.dtd"> <data-sources> <data-source class="com.evermind.sql.DriverManagerDataSource" name="Hsqldb" location="jdbc/HsqldbCoreDS" xa-location="jdbc/xa/HsqldbXADS" ejb-location="jdbc/HsqldbDS" connection-driver="org.hsqldb.jdbcDriver" username="sa" password="" url="jdbc:hsqldb:./database/defaultdb" inactivity-timeout="30" /> </data-sources>
<<property name="datasource-context" >>
. Specifies the context for the datasource.
The path is a classpath to the resource (the resource needs to be present in the MMBase classpath). If the resource is a .xml file located in the org.mmbase.storage.implementation.database.resources package, you can use shortcut notation as follows :
The storage will automatically expand the name to its correct resource path.
Available resources:
[empty] (recommended). Causes MMBase to attempt to select the database resource by itself, based on information from the database JDBC Driver. A lookup table exists which contains information on the most common drivers for the supported databases.
mysql. Selects the predefined MySQL database resource
postgresql. Selects the predefined PostGreSQl database resource
hsqldb. Selects the predefined HSQLDB database resource
hypersonic. Selects the predefined Hypersonic database resource
informix. Selects the predefined Informix database resource
Example 5. An example jdbc.xml
<?xml version="1.0"?> <!DOCTYPE module PUBLIC "-//MMBase/ DTD module config 1.0//EN" "http://www.mmbase.org/dtd/module_1_0.dtd"> <module maintainer="mmbase.org" version="0"> <status>active</status> <classfile>org.mmbase.module.database.JDBC</classfile> <properties> <property name="supportclass">org.mmbase.module.database.DatabaseSupportShim</property> <property name="driver">com.mysql.jdbc.Driver</property> <property name="url">jdbc:mysql://$HOST:$PORT/$DBM</property> <property name="user">mmbase</property> <property name="password">mypassword</property> <property name="database">mmbase_db</property> <property name="host">localhost</property> <property name="port">3306</property> <property name="connections">20</property> <!-- size of connection pool --> <property name="queries">256</property> <!-- connections are refreshed after 256 uses --> <property name="probetime">300</property> <!-- running connections are checked once every 300 s --> </properties> </module>
This is part of the MMBase documentation.
For questions and remarks about this documentation mail to: documentation@mmbase.org