1 Reply Latest reply on Jun 16, 2008 1:07 PM by jquintanam

    using mySQL inside EJB

      Hi everybody

      Something is wrong in my JBOSS server.

      I've developed a program that uses a mySQL database as follows:

      public class C1Bean implements SessionBean {
      .........
      public int activate(){
      try {
      Class.forName("com.mysql.jdbc.Driver").newInstance();
      }
      catch (Exception ex) {
      return ( -1);
      }
      return (0);
      }
      ..........


      The imported library is : mysql-connector-java-3.1.7.bin.jar

      The program is deployed ok, but when the method is invoked, always returns -1.

      If the program is used locally, that is, calling this method locally (no Jboss), the program runs ok.

      Does JBOSS run Ok if a database connector is needed?. Do I need to add something else to the JBOSS configuration?

      Regards
      Pepe