Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Failure in loading T2 native library db2jcct2

843854Nov 16 2004 — edited Nov 20 2014
This is the error I get.

com.ibm.db2.jcc.c.SQLException: Failure in loading T2 native library db2jcct2
at com.ibm.db2.jcc.t2.a.a(a.java:31)
at com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Configuration.java:40)

I have
db2java.zip
db2jcc.jar
in my class path, is there a DLL missing or what do I have to do to allow me to use this driver?
Thanks ...
  public static Connection setUpConnectionToDB( String url, String user, String pwd){
    //url = "jdbc:db2:VUMSTMEL"
    System.out.println("connecting to Database using " + url);
    Connection c = null;
    try{
      Class.forName("com.ibm.db2.jcc.DB2Driver");  
      
      // establish a connection to DB2
      c = DriverManager.getConnection(url,user,pwd);
    }
    catch(ClassNotFoundException e){
       JOptionPane.showMessageDialog(null , "Class not found");
       System.exit(0);
    }
    catch(SQLException e){
       e.printStackTrace();
       JOptionPane.showMessageDialog(null , "SQL Exception");
       System.exit(0);
    }
    catch(Exception e){
       JOptionPane.showMessageDialog(null , "Error connecting to DB, check config file" + e.getClass());
       System.exit(0);
    }

    System.out.println("connected to Database");
    return c;
  }
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2007
Added on Nov 16 2004
3 comments
522 views