Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Posts
    8

    Unanswered: Problem connecting to DB2 from Java

    Hi. I'm running a small Java app on an AIX server connecting to a DB2 database. Here's the code:

    String dbURL = "jdbc:db2:icmdb01";
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    System.out.println("Connecting to Database URL = " + dbURL);
    db = DriverManager.getConnection(dbURL);

    The error I'm getting is:

    java.sql.SQLException: No suitable driver
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(Compiled Code)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at TestConnect.main(Compiled Code)

    I've included the DB2 driver in the classpath. If I remove the DB2 driver from the classpath, I get a "ClassNotFound" error. So this tells me that it's something else. Any ideas?

  2. #2
    Join Date
    Aug 2002
    Posts
    8
    Anyone seen this error before?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •