Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010

    Question Unanswered: CallableStatement (JDBC) API doesn't support setInt?

    I am trying to execute a simple DB2 stored procedue. Below is the snippet of the code:

    CallableStatement cs3 = con.prepareCall("CALL my_proc5(?, ?)");
    cs3.setInt("n1", 3);
    cs3.registerOutParameter(2, Types.CHAR);

    String c2 = cs3.getString(2);
    System.out.println("c2: " + c2);

    It keeps complainin the setInt is not supported. This is the error message I get:
    Exception in thread "main" [jcc][10183][10229][4.0.100] JDBC 3 method called: Method is not yet supported. ERRORCODE=-4450, SQLSTATE=null

    I am running using db2jcc4.jar, which according to the docs should support setInt for CallableStatement. The exact driver version (from DatabaseMetaData() is:4.0.100

    I have also tried using setObject, but no luck with that. Also when establishing connection, I set the following:
    props.put("DB2_USE_DB2JCCT2_JROUTINE", "TRUE");
    props.put("driverType", "4");

    Still no luck. What am I missing here?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    Try using setInt(int, int) instead of setInt(String, int).

  3. #3
    Join Date
    Mar 2010
    Quote Originally Posted by n_i View Post
    Try using setInt(int, int) instead of setInt(String, int).
    Yes, setInt(int, int) works. Still curious why setInt(String, int) didn't work - eventhough the driver says that it supports the JDBC 4.0 API

Posting Permissions

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