ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

ODBC Connection failure

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ODBC Connection failure

    Hello,

    I get the feeling this is a simple one but just don't have clue what the answer is.

    I have a very simple bit of java that's running a bit of SQL using the JDBC-ODBC bridge driver.

    When i run it i get...

    java.sql.SQLException: [IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8500 - C
    WB0999 - Unexpected error: unexpected return code 8500
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc .java:6958)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java :7115)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.j ava:3074)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOd bcConnection.java:323)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDrive r.java:174)
    at java.sql.DriverManager.getConnection(DriverManager .java:525)
    at java.sql.DriverManager.getConnection(DriverManager .java:171)
    at ASTest.main(ASTest.java:14)

    I have never had this working using the iSeries Access ODBC Driver as we normally use the DB2 universal driver so it probably some thing set up wrong.

    iSeries Access v5.2
    OS/400 v4.5

    Its works in OpsNav.

    Any ideas ?

    Thanks,
    Andy.

  • #2
    Re: ODBC Connection failure

    Can you post your Code?
    Predictions are usually difficult, especially about the future. ~Yogi Berra

    Vertical Software Systems
    VSS.biz

    Comment


    • #3
      Re: ODBC Connection failure

      Originally posted by andy View Post
      Hello,


      I have never had this working using the iSeries Access ODBC Driver as we normally use the DB2 universal driver so it probably some thing set up wrong.

      iSeries Access v5.2
      OS/400 v4.5

      Its works in OpsNav.
      Wow, that's quite a difference between the Access and OS/400 version. Might still be okay, though. I've connected V5.3 of Access to a V4.5 machine. Really depends on the service pack level of Access. Check that first, to make sure you're up to date on your Access.

      Does any documentation say that OpsNav uses the bridge? I always thought it was straight JDBC.

      Jonas
      Jonas Temple
      Got FROG?
      Got Tadpole? No, because it's not done yet! Stay tuned....

      01010111 01100001 01110011 01110011 01110101 01110000 00100000 01100100 01101111 01100111 00111111

      Comment


      • #4
        Re: ODBC Connection failure

        Here's the code.

        Jonas - you say you think it uses JDBC, if this is the case maybe there's a better way to do this ? The only reason I'm going down this route is that were have v8 of the DB2 universal client which uses system defined stored procedures to retieve DB2 catalog information. These procedures dont exist on v4r5 so you end up with a big explosion !

        PHP Code:
        import java.sql.*;

        class 
        ASTest
        {

          public static 
        void main(String[] args)
          {
             try
             {

                 Class.
        forName("sun.jdbc.odbc.JdbcOdbcDriver");

                 
        String url "jdbc:odbc:AS400001";
                 
        Connection con DriverManager.getConnectionurl"user1""password");

                 
        String user "user2";
                 
        String password "password";
                 
        CallableStatement proc con.prepareCall("{ call qsys.rstas4pwd(?,?) }");
                 
        proc.setString(1user);
                 
        proc.setString(2password);
                 
        proc.execute();

                 
        System.out.println("Query has run.");

                 
        proc.close();


               }
             catch (
        Exception e)
               {
                   
        e.printStackTrace(System.err);
               }

          }


        Comment


        • #5
          Re: ODBC Connection failure

          The code is right. I was able to get it running on a v5r2 box. I would follow Jonas's recommendations.
          Predictions are usually difficult, especially about the future. ~Yogi Berra

          Vertical Software Systems
          VSS.biz

          Comment


          • #6
            Re: ODBC Connection failure

            Dont worry guys I've sorted it.

            Turns out it was just an access issue. The account I was using in the code didn't have the right access set up to use Client Acess ODBC.

            When I tried it in OpsNav it worked because i was logged on with a different profile.

            Comment

            Working...
            X