1 Reply Latest reply on Apr 10, 2006 12:34 PM by Peter Johnson

    configure and use Jboss with MySQL Database instead of the H

    hemo phililac Newbie

      Hello,

      I've got a problem in managing my Jboss configuration.

      I want to program an application based on servlets with a good database in the background. Therefore I thought it is best to use a new jboss version (best would be 3.x) and a new mysql version (best 5.0).

      But ive no idea how to configure the Jboss, so that i am able to use a mysql database instead of the hypersonic one.

      Does anyone know a good tutorial (all tutorials I found are made for older versions and are not working probably!!!) AND does anyone has an example (best wold be a little programm or tutorial) how I can communicatie with the MYSQL database in JBOSS with JAVA Code.

      Sorry... In this case im a complete beginner and I'm really afraid of installing JAVA software (it never works :-)). It wold be great if you can explain it detaily...

      Please do not post that i only have to put the mysql-connector in the deploy directory! This cant be the only thing (or im just too silly!)

      Thanks much and sorry for my bad english (I'm German :-))

      Jan

        • 1. Re: configure and use Jboss with MySQL Database instead of t
          Peter Johnson Master

          Will you be using the Java messaging service in your application? If not, you don't have to change any of the Hypersonic database configuration since it mostly relates to storing messages.

          Very simply, to use a database in your application you have to:

          1. Copy the connector jar file to the server/default/lib directory
          2. Create a data source configuration file named XXX-ds.xml and place it into server/default/deploy (where XXX is any name you want). See docs/examples/jca for example configuration files.
          3. Write Java code to access the database using the data source you configured. For this you can use JDBC, iBatis, Hibernate, the list is endless.

          For good references on database access in JBoss, check out the books JBoss at Work: A Practical Guide by Marrs and Davis, or JBoss: A Developer's Notebook by Richards and Griffith. Both discuss accessing data in a database. However the JBoss at Work book uses the Hypersonic database (not sure about the Developer's Notebook - it's at home and I'm at work so I can't double-check it.)

          For tutorials on configuring and using MySQL with JBoss, just google "jboss mysql tutorial" and you will get lots of hits that look promising.