Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2002
    Posts
    12

    Unanswered: No Sutable Driver Found Error

    On WebLogic Linux server I'm running a servlet and trying to connect to db2. I get the following error: 'No suitable driver '

    Here is the code that I use to connect:

    try {
    String driver = "COM.ibm.db2.jdbc.app.DB2Driver";
    Class.forName(driver);

    }catch(Exception e){
    throw(new UnavailableException(this, "Sorry! The Database didn't load!"));}

    try {
    String url = "jdbc:db2:" + LOGID_DATA_SOURCE;
    con = DriverManager.getConnection (url,LOGID_USER,LOGID_PASSWORD);
    stStatement = con.createStatement();
    }catch (SQLException e) {
    out.println("SQL Exception: " + e.getMessage() + "\n");
    }


    I also set up following environment variables:
    export CP_CLASSPATH=/home/db2clnt7/sqllib/java/sqlj.zip:/home/db2clnt7/sqllib/java/db2java.zip:/home/db2clnt7/sqllib/java/runtime.zip
    export CP_LD_LIBRARY_PATH=/home/db2clnt7/sqllib/lib
    export CP_PATH=/home/db2clnt7/sqllib/bin:/home/db2clnt7/sqllib/adm:/home/db2clnt7/sqllib/misc

    Can you please advise what am I doing wrong? And why am I getting 'No suitable driver found error"

    Thanks in advance

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: No Sutable Driver Found Error

    Originally posted by Ane4ka
    On WebLogic Linux server I'm running a servlet and trying to connect to db2. I get the following error: 'No suitable driver '

    Try using NET driver (COM.ibm.db2.jdbc.net.DB2Driver) instead of the APP driver.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Dec 2002
    Posts
    12

    Re: No Sutable Driver Found Error

    Originally posted by n_i
    Try using NET driver (COM.ibm.db2.jdbc.net.DB2Driver) instead of the APP driver.
    That didn't help.

    Thanks!

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: No Sutable Driver Found Error

    Originally posted by Ane4ka
    That didn't help.

    Thanks!
    Well, the error you get can only mean two things: either the driver didn't load properly or it can't handle the url you're trying to pass to it. Check the url syntax and ensure that the driver loads (no security violation etc.). See if WebLogic log files contain any useful information.

    As a side note, I think you would want to use WebLogic's JDBC connection pool instead of establishing your own connections from a servlet...
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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