Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Location
    Mexico City
    Posts
    2

    Question Unanswered: Problems withd DB2 and Java 1.2

    Hello partners.
    I have some troubles trying to connect to a remote database in DB2, Version 8.2, from a Java Class.

    I`m using the following code:

    Code:
        String DRIVER = "COM.ibm.db2.jdbc.app.DB2Driver";
    
        String URL = "jdbc:db2://200.33.154.10:50200/BAFBP001";
             try
             {
                Class.forName(DRIVER);
                 }
             catch(Exception ex)
             {
                System.out.println("Error");
             }
          //more code
          .
          .
               Connection con = DriverManager.getConnection(URL,"dbjj","dbjjk002");
           
          //more code
    The problem is that the program can find the driver, but in the moment that tries to find the DB, I got a SQL exception: "No suitable Driver"

    The driver used is DB2Java.zip. I tried with db2jcc.jar and the license driver and it worked perfectly in my local host and local server, but I found that those drivers are not compatible with the JDK 1.2, used by the Websphere 3.5, and I got the horrible "Major minor exception". The big deal is that I need to make it work on that old Websphere.

    The weird thing that I found is that when I try to contact the Database using Eclipse or my DB2 Client, I can do it without any problems, using the same IP, Port and DataBase name.

    I hope I explain myself well. If any of you have some suggests or solutions, are well received. Or if you have an old DB2 driver for jdk 1.2, you will save my life.

    Thank you all.
    Last edited by IvanJ2EE; 06-22-07 at 18:20.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    That's not a correct URL for the app driver. You will need to catalog the database:
    Code:
    db2 catalog tcpip node mynode remote 200.33.154.10 server 50200
    db2 catalog database BAFBP001 at node mynode
    and use the cataloged name in the URL:
    Code:
    ...
    String URL = "jdbc:db2:BAFBP001";
    ...
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jun 2007
    Location
    Mexico City
    Posts
    2

    Smile Thank you

    My friend thank u very much, that`s what I call an excellent solution.
    Thank you so much, you just saved my life...

    God Bless GURU´S like u

    See ya

Posting Permissions

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