Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012
    Posts
    2

    Unanswered: JDBC driver connection

    Hi at all,

    A am developing an application that have to connect a DB2 Database system with JDBC driver.
    I am using a licensed driver (db2jcc.jar with license jar).

    I am able to call simple stored procedure bu i have some problem when i try to invoke a stored procedure that returns a complex out argument.

    I have tried with something like this:

    com.ibm.db2.jcc.DB2SimpleDataSource ds = new com.ibm.db2.jcc.DB2SimpleDataSource();
    // set connection properties
    ds.setServerName("AC-PC");
    ds.setPortNumber(50000);
    ds.setDatabaseName("sample");
    ds.setDriverType(4);
    java.sql.Connection con = ds.getConnection("db2admin", "db2admin");
    // execute a query
    String query = "CALL DB2ADMIN.TEST('12', ?)";
    java.sql.CallableStatement stmt = con.prepareCall(query);
    stmt.registerOutParameter (1, Types.STRUCT);
    stmt.execute();
    but i have the following error:
    ERRORCODE=-4228, SQLSTATE=null
    This error is raised by following java statement:
    stmt.registerOutParameter (1, Types.STRUCT);
    Is java.sql.Types.STRUCT not supported by IBM Driver?

  2. #2
    Join Date
    Feb 2012
    Posts
    2
    How can i use Types.STRUCT with IBM driver?
    Did you ever deal with this kind of problem?

    Thanks at all!

Posting Permissions

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