4 Replies Latest reply on May 16, 2003 12:47 PM by ne0fite

    Help with DataSource Config

    xinxin

      Hi, could anyone help me?
      I am using WSAD5.0 for developing the J2EE Application, and now one of our clients wants to run our project using JBoss. We are going to run JBoss on a workstation and access the database on the AS/400. I know nothing about JBoss, and I have read some documents, but still do not understand how to config a datasoure with database AS/400. Any examples would be so appreciated.
      Thanks a lot!

        • 1. Re: Help with DataSource Config
          jonlee

          You should be using a 3.2.x release. You are configuring a datasource so you need to copy an appropriate one from the docs/examples/jca directory in your JBoss distribution. Put your copy in the JBoss deploy directory - executing the JBoss run script without any arguments will run the default instance. This runs the JBoss microkernel with all the services in the server/default directory of your distribution. So you would put the datasource configuration file in server/default/deploy. The file must be called *-ds.xml for JBoss to install it as a datasource configuration. For DB2, you can leave it as db2-ds.xml, or you can call it with the name of your pool, etc. e.g. MyFirstDb-ds.xml.

          The file looks something like this:
          <?xml version="1.0" encoding="UTF-8"?>

          <!-- ===================================================================== -->
          <!-- -->
          <!-- JBoss Server Configuration -->
          <!-- -->
          <!-- ===================================================================== -->

          <!-- $Id: db2-ds.xml,v 1.1 2002/07/22 22:57:24 d_jencks Exp $ -->



          <local-tx-datasource>
          <jndi-name>DB2DS</jndi-name>
          <connection-url>jdbc:db2:yourdatabase</connection-url>
          <driver-class>COM.ibm.db2.jdbc.app.DB2Driver</driver-class>
          <user-name>x</user-name>
          y
          <min-pool-size>0</min-pool-size>
          <max-pool-size>100</max-pool-size>
          </local-tx-datasource>


          Adjust the database login, the JDBC URL and the pool size according to your needs. Also change the JNDI name to something appropriate for your beans to reference.

          Lastly, drop the JDBC driver for DB2 into server/default/lib so that JBoss can pick this up to instantiate the JDBC driver. Use the type 4 JDBC driver as the type 2 has problems with picking up the native libraries.

          That is it for configuring the datasource connection pool.

          • 2. Re: Help with DataSource Config
            xinxin

            Thank you jonlee for replying.

            I think my JBoss is version 3.0.2, and sould the datasource config steps be same as you said?

            Thanks

            • 3. Re: Help with DataSource Config
              xinxin

              And also do I need to config the MBean?

              Thanks

              • 4. Re: Help with DataSource Config
                ne0fite

                No. If you are using 3.0.x then the datasource config steps are different.