2 Replies Latest reply on Feb 3, 2014 3:15 PM by Praveen Sankar

    DB2 datasource schema configuration help

    Praveen Sankar Newbie

      Our application is running on Jboss 5.1 as, and DB2 database, I am trying to connect DB2 using JDBC Type4 configuration, I followed the example from jca/db2-xa-ds.xml.


      I would like to know is there a way to specify the schema name in this configuration, JBoss prefixes the DB2 username before the table name in the SQL queries.


      In one of the forums I saw "<xa-datasource-property name="currentSchema">SCHEMA NAME</xa-datasource-property>"  I tried this with NO luck.


      Is any one have any suggestions, how to give schema name so that Jboss will prefix the schema name instead of DB2 username. Any help will be much appreciated.




        • 1. Re: DB2 datasource schema configuration help
          Urs Rothenhäusler Newbie


          in JBoss 7.1.1 with a normal datasource I got it working with:




          This should also work in JBoss 5.1 with a xa-datasource.

          • 2. Re: DB2 datasource schema configuration help
            Praveen Sankar Newbie

            I see the sample db2-xa-ds.xml in JCA directory doesn';t  have <connection-url>


            Here is the db2-xa-ds.xml from jca directory, I followed this file.  Could you please send me an example how to use <connection-url>

            <?xml version="1.0" encoding="UTF-8"?>

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

            <!--    -->

            <!--  JBoss Server Configuration    -->

            <!-- Thanks to Horia Muntean <horia@bvb.ro>   -->

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

            <!-- $Id: db2-xa-ds.xml 77479 2008-08-26 10:33:09Z alex.loubyansky@jboss.com $ -->



                   XADatasource for DB2 V8.1 (app driver)

                   copy $db2_install_dir/java/db2java.zip into $jboss_install_dir/server/default/lib




                 <!-- uncomment to enable interleaving <interleaving/> -->



                 <xa-datasource-property name="DatabaseName">yout_database_name</xa-datasource-property>

                 <xa-datasource-property name="User">your_user</xa-datasource-property>

                 <xa-datasource-property name="Password">your_password</xa-datasource-property>

                  <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->