In order to use the J2EE stores, the Domain.xml file needs to contain the following configuration for the store:
<definition>
<store name="j2ee">
<nodestore classname="org.apache.slide.store.impl.rdbms.J2EEStore">
<parameter name="datasource">jdbc/mtx</parameter>
<parameter name="adapter">org.apache.slide.store.impl.rdbms.MySqlRDBMSAdapter</parameter>
<parameter name="compress">false</parameter>
</nodestore>
<securitystore>
<reference store="nodestore"/>
</securitystore>
<lockstore>
<reference store="nodestore"/>
</lockstore>
<revisiondescriptorsstore>
<reference store="nodestore"/>
</revisiondescriptorsstore>
<revisiondescriptorstore>
<reference store="nodestore"/>
</revisiondescriptorstore>
<contentstore>
<reference store="nodestore"/>
</contentstore>
</store>
<scope match="/" store="j2ee"/>
</definition>
where the adapter determines which database adapter you want to use. In this case you configured the MySQL adapter. Most adapters
have a parameter to decide whether the content shall be compressed (zipped) before storing to the database. This might
be fast in some enviroments. This option is switched off here.
You have to create the tables of the database schema manually. Schemata are available in
src/conf/schema if you have the source distribution or in slide/db-schema if you have the Tomcat bundled or binary distribution.
If your store is not configured using a datasource looked up using JNDI you will have to provide more information to Slide
like this for example:
<definition>
<store name="MySqlStore">
<nodestore classname="org.apache.slide.store.impl.rdbms.JDBCStore">
<parameter name="adapter">org.apache.slide.store.impl.rdbms.MySqlRDBMSAdapter</parameter>
<parameter name="driver">com.mysql.jdbc.Driver</parameter>
<parameter name="url">jdbc:mysql://localhost/Slide</parameter>
<parameter name="user">root</parameter>
<parameter name="isolation">SERIALIZABLE</parameter>
<parameter name="compress">false</parameter>
<parameter name="dbcpPooling">true</parameter>
<parameter name="dbcp.maxActive">10</parameter>
<parameter name="dbcp.validationQuery">SELECT 1</parameter>
<parameter name="dbcp.maxWait">5000</parameter>
<!-- Set arbitrary (semicolon-separated) properties for the JDBC-driver:
<parameter name="dbcp.connectionProperties">cachePrepStmts=true;prepStmtCacheSqlLimit=512</parameter> -->
</nodestore>
<contentstore>
<reference store="nodestore" />
</contentstore>
<securitystore>
<reference store="nodestore" />
</securitystore>
<lockstore>
<reference store="nodestore" />
</lockstore>
<revisiondescriptorsstore>
<reference store="nodestore" />
</revisiondescriptorsstore>
<revisiondescriptorstore>
<reference store="nodestore" />
</revisiondescriptorstore>
</store>
<scope match="/" store="MySqlStore"/>
</definition>
You can see you will have to configure you driver, the connection url and the user for the database. You can optionally configure
if connection pooling using DBCP is enabled or not and if enabled how many connections shall be pooled. If you want you can
also choose the isolation level of your database. SERIALIZABLE
is a safe choice, but - depending on you database - at least READ COMMITTED
is recommended.