Error in java while getting connected to DB2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qpmzlaks
    New Member
    • Sep 2007
    • 1

    #1

    Error in java while getting connected to DB2

    Hello,
    I was trying to get connected to DB2 from java using a Atomikos datasource.
    This is the config for the same;
    <bean id="dataSourceA tom1"
    class="com.atom ikos.jdbc.Simpl eDataSourceBean " init-method="init"
    destroy-method="close">
    <property name="uniqueRes ourceName">
    <value>TestDB 2</value>
    </property>
    <property name="xaDataSou rceClassName">
    <value>com.ibm. db2.jcc.DB2XADa taSource</value>
    </property>
    <property name="xaDataSou rceProperties" value="serverNa me=localhost;po rtNumber=50001; databaseName=te stdb2;user=db2a dmin;password=P ass123$$;" />
    <property name="exclusive ConnectionMode" >
    <value>true</value>
    </property>
    </bean>
    It throws;
    com.ibm.db2.jcc .b.SqlException : Failure in loading T2 native library db2jcct2, reason: java.lang.Unsat isfiedLinkError : db2jcct2 (Not found in java.library.pa th)
    I have the db2jcc.jar and db2jcc_license_ cisuz.jar file in the classpath and it works fine with the url: jdbc:db2://localhost:50001/testdb2.
    I think it has something to do with the xaDataSourcePro perties. Can anyone help here. Thanks
Working...