1

I am trying to connect to DB2 in an OSGi bundle on jvm server on CICS using type 2 connectivity and I am getting the below error.

com.ibm.db2.jcc.am.SqlException: Failure in loading native library db2jcct2zos_64, java.lang.UnsatisfiedLinkError: db2jcct2zos_64 (Not found in java.library.path): ERRORCODE=-4472, SQLSTATE=null

I have referred the directory containing the libdb2jcct2zos.so, ibdb2jcct2zos_64.so, libdb2jcct2zos4.so, libdb2jcct2zos4_64.so files in LIBPATH_SUFFIX in JVM profile of OSGi.

If I try to load these DLLs in java program using System.load("/usr/db2/v10/jdbc/lib/libdb2jcct2zos_64.so"), I get the error of

"EDC5205S DLL module not found".

kushwah_a
  • 135
  • 2
  • 9

2 Answers2

0

As referred to in the answer to the question you asked yesterday, there are a number of changes you need to make to use DB2 from an OSGi JVM server:

  • In the CICS job, adding the DB2 datasets to the STEPLIB
  • In the JVM profile, referring to the DB2 libraries in the LIBPATH_SUFFIX attribute
  • In the JVM profile, installing the DB2 bundles via the OSGI_BUNDLES attribute
Community
  • 1
  • 1
Ben Cox
  • 1,393
  • 10
  • 28
  • Indeed there was an environment problem and we had to make changes in region's steplib, now that error is not coming.. I am getting the below error. com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][50053][12311][3.69.56] T2zOS exception: [jcc][T2zos]T2zosConnection.flowConnect:execConnect:1425: DB2 engine SQL error, SQLCODE = -922, SQLSTATE = 42505, error tokens = PLAN ACCESS;00F30034 ERRORCODE=-922, SQLSTATE=42505 Using the below java code to connect to DB2 – kushwah_a Feb 01 '17 at 07:02
  • jdbcURL = "jdbc:default:connection"; try { connection = DriverManager.getConnection(jdbcURL); connection.setAutoCommit(false); } catch (SQLException e) { System.out .println("SQLException Exception in getting the connection"); e.printStackTrace(); throw e; } – kushwah_a Feb 01 '17 at 07:02
  • If you look up those codes, you discover that it failed because the user running the JDBC does not have authority to use the specified DB2 plan or the plan doesn't exist. See the 'planName' property at https://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/java/src/tpc/imjcc_r0052040.html for an example of how to alter the plan that's used, or ensure the user is authorised to the plan. – Ben Cox Feb 01 '17 at 10:49
  • I have tried giving jdbc:default:connection in the URL connection = DriverManager.getConnection(" jdbc:default:connection") as the default URL and I have also tried the explicit URL, I get the same error, where in cics I should check to confirm what do i need to provide? Additionally I have a DB2Conn resource in my region and its PLAN property says Default, do I need to create DB2Entry/DB2Tran resources as well. – kushwah_a Feb 02 '17 at 10:26
  • Some of the DB2Conn Properties after doing CEMT i DB2Conn: Authid( ) Authtype( Sign ) and Signid( ABCDCICS ) Plan( DEFAULT ) .. So what should I ask my system adminstrator regarding the access as I dont have access to change the DB2Conn? I am following link and it seems like the ABCDCICS does not have access to access the default plan that's why the java programs are not able to use T2 driver to connect to DB2 , is my understanding correct?planhttps://www.ibm.com/support/knowledgecenter/en/S‌​SEPEK_10.0.0/codes/s‌​rc/tpc/n922.html – kushwah_a Feb 03 '17 at 10:27
0

Faced the same issue as described by @kushwah_a. Added the JDBC DSN(db2hlq.SDSNLOD2) in the STEPLIB of CICS start up procedure. Finally OSGI JVM server picked the proper dll(db2jcct2zos_64.so) from the lib(usually, /usr/lpp/db2version/jdbc/lib) and established the JDBC connection.