JOnAS Tutorial | ||
---|---|---|
<<< Previous | Getting Started With JOnAS | Next >>> |
Any database with a JDBC driver can be used with JOnAS. Sample properties files are provided for Oracle, InstantDB, Interbase and PostgreSQL. If you want to setup a new database you can modify one of those configuration files to suit your database driver requirements. Here is a minimal example 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 # Test statement jdbc.connteststmt select 1 |
Note that mysql_ds is the name that you will have to use in your beans deployment descriptors to reference this datasource. Also if you called this file mysql.properties, you must define a line like jonas.service.dbm.datasources mysql in your jonas.properties file.
<<< Previous |
Home
Up | Next >>> |