Defining a Datasource

This example requires that a datasource named jdbc_1 is available in the JOnAS server. This is the default name used in the database properties files provided in the $JONAS_ROOT/conf directory. If there is no suitable properties file for your database, here is a quick example on how to setup one for use with MySQL and the MM.MySQL JDBC driver:

#####
#  DataSource configuration
#
datasource.name         	mysql_ds
datasource.url          	jdbc:mysql://localhost/mytestdb
datasource.classname    	org.gjt.mm.mysql.Driver
datasource.username     
datasource.password     
datasource.mapper		rdb.mysql 


#####
#  ConnectionManager configuration
#

#  JDBC connection checking level.
#     0 = no special checking
#     1 = check physical connection is still open before reusing it
#     2 = try every connection before reusing it
jdbc.connchecklevel	1

#  Max age for jdbc connections
#     nb of minutes a connection can be kept in the pool
jdbc.connmaxage		30

If you call this file mysql.properties, you must define the following line in in your jonas.properties file:
jonas.service.dbm.datasources    mysql