ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Unable to connect DB2 using JDBC provider

Post new topic  Reply to topic
 Unable to connect DB2 using JDBC provider « View previous topic :: View next topic » 
Author Message
anilmekala
PostPosted: Sun May 26, 2013 5:45 am    Post subject: Unable to connect DB2 using JDBC provider Reply with quote

Acolyte

Joined: 19 Oct 2012
Posts: 63

Hi ,

I am trinyg to connect DB2 using JDBC providers . I have followed below steps.
1) created configurable services inMB explorer

mqsichangeproperties ANIL_BK -c JDBCProviders -o DB2 -n " \"connectionUrlFormat\", \"connectionUrlFormatAttr1\", \"connectionUrlFormatAttr2\", \"connectionUrlFormatAttr3\", \"connectionUrlFormatAttr4\", \"connectionUrlFormatAttr5\", \"databaseName\", \"databaseType\", \"databaseVersion\", \"description\", \"environmentParms\", \"jarsURL\", \"maxConnectionPoolSize\", \"portNumber\", \"securityIdentity\", \"serverName\", \"type4DatasourceClassName\", \"type4DriverClassName\" " -v " \"jdbc:db2://[serverName]:[portNumber]/[databaseName]:user=[user];password=[password];\", \"\", \"\", \"\", \"\", \"\", \"SAMPLE\", \"DB2 Universal Database\", \"9.1\", \"default_Description\", \"default_none\", \"C:\Program Files\IBM\SQLLIB\java\", \"0\", \"50000\", \"default_User@default_Server\", \"localhost\", \"com.ibm.db2.jcc.DB2DataSource\", \"com.ibm.db2.jcc.DB2Driver\" "

2) Restarted the broker

3) I have added below code in my java class to retrieve employee info

Connection conn = getJDBCType4Connection("SAMPLE",
JDBC_TransactionType.MB_TRANSACTION_AUTO);

// Example of using the Connection to create a java.sql.Statement
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet srs0 = stmt.executeQuery("SELECT emp_id,emp_name,emp_dept FROM ADMINISTRATOR.EMPLOYEE");

4) I am getting below exception when i debug the code :

java.lang.NullPointerException
at com.ibm.broker.jdbctype4.connfact.JDBCType4ConnectionFactory.checkVendorSupportsXA(JDBCType4ConnectionFactory.java:231)
at com.ibm.broker.jdbctype4.connfact.JDBCType4ConnectionFactory.getConnection(JDBCType4ConnectionFactory.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.broker.plugin.MbNode.getJDBCType4Connection(MbNode.java:1556)
at SAMPLE_JAVACOMPUTE_INSERT_JDBCPROVIDER_JavaCompute.evaluate(SAMPLE_JAVACOMPUTE_INSERT_JDBCPROVIDER_JavaCompute.java:23)
at com.ibm.broker.javacompute.MbRuntimeJavaComputeNode.evaluate(MbRuntimeJavaComputeNode.java:232)
at com.ibm.broker.plugin.MbNode.evaluate(MbNode.java:1472)
Please help me how to resolve this error.

Thanks in advance ..

Regards,

Anil
Back to top
View user's profile Send private message
anilmekala
PostPosted: Sun May 26, 2013 6:35 am    Post subject: Reply with quote

Acolyte

Joined: 19 Oct 2012
Posts: 63

Hi ,
am getting below thing exception. when i clearly dig into exceptionlist.

Unable to obtain JDBC Connection

Please help me to resolve the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Unable to connect DB2 using JDBC provider
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.