com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][4.19.26] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path: ERRORCODE=-4472, SQLSTATE=null

Pentaho BI Platform Tracking | Adam Swartz | 2 months ago
  1. 0

    A type 2 driver uses native code to connect to the database without a password when connecting on the local server. This is useful for deployments as it does not expose the password or require password management through another tool. I suggest modifying the getURL call to the following: public String getURL( String hostname, String port, String databaseName ) { if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_ODBC ) { return "jdbc:odbc:" + databaseName; } else { // if we are running on the local host then try to use the // native type 2 driver, else use a type 4. // type 2 drivers can connect without user credentials. String localhost = ""; String fullhost = ""; try { localhost = InetAddress.getLocalHost().getHostName(); fullhost = InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { } if (hostname != null && ( hostname.trim().length() == 0 || hostname.equals("localhost") || hostname.equals(localhost) || hostname.equals(fullhost))) return "jdbc:db2:" + databaseName; else return "jdbc:db2://" + hostname + ":" + port + "/" + databaseName; } } I have tested this locally and the type 2 connection works. You do however have to address the use of java.library.path in spoon.sh so it can load the JNDI, but I opened another defect for that. Without that you would get: com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][4.19.26] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path: ERRORCODE=-4472, SQLSTATE=null at com.ibm.db2.jcc.am.kd.a(Unknown Source) at com.ibm.db2.jcc.am.kd.a(Unknown Source) at com.ibm.db2.jcc.am.kd.a(Unknown Source) at com.ibm.db2.jcc.t2.a.a(Unknown Source) at com.ibm.db2.jcc.t2.T2Configuration.<clinit>(Unknown Source) at com.ibm.db2.jcc.DB2Driver.connect(Unknown Source) at com.ibm.db2.jcc.DB2Driver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:664) I still suggest doing this change apart from that as it is easy to manage spoon.sh vs managing a java class change.

    Pentaho BI Platform Tracking | 2 months ago | Adam Swartz
    com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][4.19.26] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path: ERRORCODE=-4472, SQLSTATE=null
  2. 0

    Hibernate connecting to DB2 at application startup on WAS Liberty on CICS

    Stack Overflow | 3 months ago | Gediminas Rimsa
    com.ibm.db2.jcc.am.SqlException: [jcc][50053][12310][4.19.56] T2zOS exception: [jcc][T2zos]T2zosCicsApi.checkApiStatus: Thread is not CICS-DB2 compatible: CICS_REGION_BUT_API_DISALLOWED ERRORCODE=-4228, SQLSTATE=null
  3. 0

    Connection pooling not used from websphere

    Stack Overflow | 2 years ago | Jimmy
    com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][3.67.27] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path: ERRORCODE=-4472, SQLSTATE=null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][4.15.113] Failure in loading native library db2jcct2

    Stack Overflow | 11 months ago | Peter Penzov
    com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][4.15.113] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path: ERRORCODE=-4472, SQLSTATE=null
  6. 0

    Issue after DB2 upgrade to 10.5

    Stack Overflow | 5 days ago | Sonali
    com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][3.64.96] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\IBM\SQLLIB_105\BIN\db2jcct2.dll: %1 is not a valid Win32 application: ERRORCODE=-4472, SQLSTATE=null

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.ibm.db2.jcc.am.SqlException

      [jcc][10389][12245][4.19.26] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path: ERRORCODE=-4472, SQLSTATE=null

      at com.ibm.db2.jcc.am.kd.a()
    2. IBM DB2
      kd.a
      1. com.ibm.db2.jcc.am.kd.a(Unknown Source)
      2. com.ibm.db2.jcc.am.kd.a(Unknown Source)
      3. com.ibm.db2.jcc.am.kd.a(Unknown Source)
      3 frames
    3. com.ibm.db2
      DB2Driver.connect
      1. com.ibm.db2.jcc.t2.a.a(Unknown Source)
      2. com.ibm.db2.jcc.t2.T2Configuration.<clinit>(Unknown Source)
      3. com.ibm.db2.jcc.DB2Driver.connect(Unknown Source)
      4. com.ibm.db2.jcc.DB2Driver.connect(Unknown Source)
      4 frames
    4. Java RT
      DriverManager.getConnection
      1. java.sql.DriverManager.getConnection(DriverManager.java:664)
      1 frame