JBoss ships Hypersonic SQL database with its installer by default, however in production environment it is not recommend to use  Hypersonic as the database, hence it has to be switched with any of the supported databases and this article would help you to just do that in a step by step manner.

So the first question comes into our mind is that which all databases are in supported configuration ? You can get answer for this question in the below link which would show you which all databases are in the supported configuration for different versions of JBoss AS6.


Steps to switch Hypersonic with an alternative database

For this example I would be using MySql database as alternative database, however the same steps can be used with different databases with there respective drivers.

  1. You have to download “mysql-connector-java-x.x.xx-bin.jar” from mysql site separately.
  2. Put “mysql-connector-java-x.x.xx-bin.jar” in the “/JBOSS_HOME/server/PROFILE/lib” directory. (here “PROFILE” means all,produciton,default etc)
  3. Create a new “mysql-ds.xml” file with the following details which is the basic configuration.
  4. <?xml version="1.0" encoding="UTF-8"?>
  5. Then put the created “mysql-ds.xml” in “/JBOSS_HOME/server/PROFILE/deploy” folder.
  6. Its done restart your server and run any client and it would connect to your database.


I have used the JNDI name as “DefaultDS” in the “mysql-ds.xml” because this JNDI is been used by  a variety of services in JBoss like JMS, EJB timers, UUID generator, etc. Hence if you want to use your own JNDI name then you would have to replace “DefaultDS” with the given JNDI name for the datasource in the following files the list if for JBoss AS6, you can use the below commend to get the similar list for different versions.

find . -name "*.*" | xargs grep -il "DefaultDS"



Middleware Magic

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.