1 Reply Latest reply on Nov 6, 2002 11:26 AM by mimi

    re: Can not bind mySQL with jboss-3.0.4

    onicom

      Hi,

      Hope this helps. I have just got MYSQL and JBOSS 3.0.2 to work beautifully together here is exacly what I did.

      1. Make a copy of mysql-service.xml and place this in the deploy directory of the server you wish to boot i.e. default.

      2. Edit this file ensuring you are using the correct driver, url connection, username and password.

      If you set the JndiName attribute to MySqlDS, for instance, make sure this carries through into your other files.

      3. If you are using a .ant.properties file (see the templates you get with the Quick Start Guide) then ensure you set the datasource.name=java:/MySqlDS (i.e. this is the same as teh JndiName attribute you set in the mysql-service.xml file)

      4. Check the type.mapping attribute and set this to mySQL otherwise JBoss goes nuts!

      5. Change any other hardcoded references to the DataSource you may have in you source files for instance: if you are using XDoclet tags check that you havn't set any parameters to DefaultDS or something.

      e.g. @ejb:resource_ref res-name="jdbc/MySqlDS"

      6. Recompile your code and/or restart your server aand away you go. Enjoy!

      Cheers

      Anthony

        • 1. Re: re: Can not bind mySQL with jboss-3.0.4
          mimi

          Anthony,

          When you used an Entity bean to get data from MYSQL did you get an SQLException stating Column not found?

          I basically cut the TestEntity bean in the template example to talk to a table in MYSQL. I also copied the TestClient and refered it to my TestEnitity bean. When I run it, I get

          javax.ejb.FinderException: Find failed: java.sql.SQLException: Column not found:
          ACCOM_CODE in statement [SELECT Accom_Code FROM ACCOMMODATION]

          It clearly is there any the sql works if I execute it from the mysql test client.

          Any Ideas?

          Thanks in Advance.

          Jag