The db service is an optional service that can be used to start a java database server in the same JVM as JOnAS.
By default the database used is HSQLDB.
Here is the part of jonas.properties
related to
db service:
###################### JOnAS DB service configuration # # Sets the name of the implementation class of the db service (hsql for example) jonas.service.db.class org.ow2.jonas.db.hsqldb.HsqlDBServiceImpl jonas.service.db.port 9001 jonas.service.db.dbname db_jonas jonas.service.db.users jonas:jonas # Multiple users #jonas.service.db.users jonas:jonas,login:password
Here it is possible to customize :
the listening port
the database name
By default, the user is named jonas with the password jonas. In order to add new users, the property jonas.service.db.users needs to be updated by using a comma separated list as follow:
jonas.service.db.users login:password,anotherlogin:password
The database may be used by Java EE component via
JDBC resource adapters or via the dbm
service. For the former case the same information (listening
port, database name, login,password) must appear in the JOnAS connector deployment descriptor, in the latter they
appear in the $JONAS_BASE/conf/HSQLDB1.properties.
So, if
these previous properties must be changed in jonas.properties, they must be
also changed in these files.
The db service has been provided in
the jonas distribution mainly to run easily the JOnAS exemple, without having to set a database
first. For most usages, the JOnAS
users should remove it from the list of services and remove also HSQL1 from
jonas.service.dbm.datasources property in
$JONAS_BASE/conf/jonas.properties
file.
For users that choose HSQLDB as database it is highly recommended to
refer to the Hsqldb
User Guide. It is worth to note that the default configuration file
used by HSQLDB server can be found in $JONAS_BASE/work/hsqldb/jonas/db_jonas.properties
directory.
In order to launch several HSQLDB instances, the configuration needs to be duplicated and the new configuration will be prefixed by jonas.service.<mynewdbservice>.