1 Reply Latest reply on May 4, 2004 3:07 AM by guydaniel

    problem with mysql ... it doesn't work

    alemito

      Hi,
      I have written a little application with a form, a servlet and a EJB session stateless which makes some queries on a db mySQL.

      It doesn't give any error message but it's like if the DB didn't exist !
      ______________________________________________________

      I have configured mysql for JBoss in this way:

      1) I have copied the JAR file of J connector to \server\default\lib
      2) I have modified the file mysql-ds.xml, standardjbosscmp-jdbc.xml, standardjawx.xml, login-config.xml .
      3) I have added and modified the file mysql-jdbc2-service.xml and deleted hsqldb-jdbc2-service.xml
      4) I have edited in the common way files ejb-jar.xml (tag <resource-ref>) and jboss.xml (tag <reference-descriptor>)
      5) I have used to find the DB and have a DataSource reference this manner (in my session bean):

      public void ejbCreate() throws CreateException{

      //connessione col DB

      Context initial=null;
      try {
      initial = new InitialContext();
      ds = (javax.sql.DataSource)initial.lookup("java:/db_banca");
      }

      db_banca is the name I have given to the <jndi-name> of my database.

      Where do I get wrong ?? Have I to config other files ?

      P.S. I know that I should use Entity bean but they are a little more complex and I have also used session bean with Weblogic ...

      thanx all