Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Location
    china
    Posts
    13

    Unanswered: who can help me? about jdbc

    I connect to db2 use jdbc ,the programe is :

    try{
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    Connection db = DriverManager.getConnection("jdbc:db2:dl","db2inst 1","db2inst1");
    Statement stmt = db.createStatement();
    System.out.println("11111111111111");
    Connection db_exec = DriverManager.getConnection("jdbc:db2:dl","db2inst 1","db2inst1");
    System.out.println("22222222222222");
    Statement ppstmt = db_exec.createStatement();

    ........


    the result of run is :

    $ java ImChangeData 3 Dj
    11111111111111
    [IBM][CLI Driver] SQL1224N A database agent could not be started to service a request, or was terminated as a result of a database system shutdown or a force command. SQLSTATE=55032


    What's the mater?

  2. #2
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    I've never used JDBC for DB2, but I'm pretty sure you have a bad connection string.
    A database agent could not be started to service a request
    A different error would have been returned if it was a bad username or password.

    Code:
    DriverManager.getConnection(url, dbUser, dbPass);
    
       Parameter: url - a database url of the form jdbc:subprotocol:subname
    url is usually in the form:
    Code:
    String url = "jdbc:sapdb://PARMA/HOTELDB";
    I know, I use...
    Code:
    String url = "jdbc:sybase:Tds:MYHOST:PORT/DBNAME";
    Check out the documentation forthe DB2 connector and make sure your connection string is correct.

Posting Permissions

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