-
1. Re: Help with DataSource Config
jonlee May 16, 2003 11:54 AM (in response to xinxin)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 May 16, 2003 12:44 PM (in response to 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 May 16, 2003 12:46 PM (in response to xinxin)And also do I need to config the MBean?
Thanks -
4. Re: Help with DataSource Config
ne0fite May 16, 2003 12:47 PM (in response to xinxin)No. If you are using 3.0.x then the datasource config steps are different.