1 Reply Latest reply on Jan 29, 2002 2:12 AM by aqil

    mySql with jboss+catalina

    aqil

      I want to use mySql with jboss+catalina . For that i copied mm.mysql-2.0.4-bin.jar to lib/ext and changed the jboss.jcml in
      C:\JbossTom\jboss\conf\catalina to the following

      <!-- ============================================= -->
      <!-- JDBC -->
      <!-- ============================================= -->


      org.gjt.mm.mysql.Driver
      fooDS


      -----------------------------------------------------

      but when i try to access the datasource , in the following code , i get the error

      [INFO,Default] javax.naming.NameNotFoundException: jdbc not bound


      try
      {
      InitialContext initialCtx = new InitialContext();
      //Get a handle to the datasource
      DataSource ds=(DataSource)initialCtx.lookup("java:comp/env/jdbc/fooDS");
      //java.sql.Connection conn=ds.getConnection();

      }catch(Exception e)
      {
      System.out.println(""+e);
      }

      looking for help regarding this problem

        • 1. Re: mySql with jboss+catalina
          aqil

          1. Copy the code below and place it in the jboss.jcml file which you will find in the /conf directory. If you are running an integrated distribution
          (jBoss + Tomcat for ex.) make sure you change the jBoss.jcml in the /conf/catalina directory as well.
          <!-- ======================================-->
          <!-- JDBC -->
          <!-- ======================================-->

          org.gjt.mm.mysql.Driver



          DefaultDS
          org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

          jdbc:mysql://192.168.10.100:3306/MyDatabaseName
          1200000
          MyDataBaseUsername
          MyDataBasePassword
          10
          false
          false
          false
          true
          120000
          1800000
          false
          false
          1.0
          0


          2. You will have to change the following attributes in the above code to
          match your specific setup:
          jdbc:mysql://192.168.10.100:3306/MyDatabaseName
          MyDataBaseUsername
          MyDataBasePassword

          For example if mySQL is on a different box your URL may be:
          jdbc:mysql://192.168.10.100:3306/BOS
          or
          if mySQl is listening on another port you will change the 3306 to that port.


          3. COMMENT OUT or remove the existing Hypersonic pool.4. In the standardjaws.xml file, which is in the same directory as the
          jboss.jcml file, change the beginning of the listing at the
          very top of the file to this.


          java:/DefaultDS
          <type-mapping>mySQL</type-mapping>
          false
          .....................
          .........................
          ......................

          5. Restart jBoss. (That's it.)

          One more thing, when you lookup for a datasource with the above setting. use
          .lookup("java:/DefaultDS").



          Regards.

          Yasir Siraj.