S2HsqldbServer is a S2 component ot start hsqldb database server when Seaser2 starts.
S2HsqldbServer requires the followings:
S2Hsqldb may be downloaded from here.
S2 and Hsqldb must be installed before using S2Hsqldb. Hsqldb should be setup as follows:
%DBDATA_PATH%
%DBDATA_NAME%
After installing these software, S2Hsqldb is installed as follows:
To use S2Hsqldb, following 3 files must be modified:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN" "http://www.seasar.org/dtd/components21.dtd"> <components namespace="S2HsqldbServer"> <component name="xaDataSource" class="org.seasar.server.hsqldb.HsqldbServerImpl"> <!-- Modify database property replacing %DBDATA_PATH% and %DBDATA_NAME% with the actual values --> <property name="database">"%DBDATA_PATH%/%DBDATA_NAME"</property> <property name="dbname">"dbname"</property> <- This row may be deleted <property name="port">9001</property> <property name="silent">false</property> <property name="trace">false</property> <property name="tls">false</property> <property name="user">"sa"</property> <property name="password">""</property> <initMethod name="start" /> <destroyMethod name="stop"> <arg>@org.seasar.server.hsqldb.HsqldbServer@SHUTDOWN_MODE_COMPACT</arg> </destroyMethod> </component> </components>
%DICON_PATH%
Modify app.dicon file as follows replacing %DICON_PATH% with the actual directory of where hsql.dicon is located.
<components> ... <include path="%DICON_PATH$/hsql.dicon"/> </components>
Deploy your application. If you are using Tomcat, start Tomcat. When S2 starts, dicon files will be read in app.dicon, hsql.dicon order.
Modify the j2ee.dicon file to set database connection information.
<component name="xaDataSource" class="org.seasar.extension.dbcp.impl.XADataSourceImpl"> <property name="driverClassName"> "org.hsqldb.jdbcDriver" </property> <property name="URL"> "jdbc:hsqldb:hsql://localhost:9001" </property> <property name="user">"sa"</property> <property name="password">""</property> </component>