Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2003
    Posts
    30

    Unanswered: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    Hi,

    i want to get back a auto generated key from v8.1 DB2 express.
    So i used a JDBC 3.0 feature:

    s.execute(sql, Statement.RETURN_GENERATED_KEYS);
    ResultSet generatedKeysRes = s.getGeneratedKeys();

    i got the error:

    com.ibm.db2.jcc.c.SqlException: JDBC 3 method called - not yet supported

    But an IBM document says that:
    supportsGetGeneratedKeys | Yes | No | No

    YES: DB2 Universal JDBC Driver support
    NO: JDBC/SQLJ 2.0 Driver for OS/390 support
    NO: DB2 JDBC Type 2 Driver support

    http://publib.boulder.ibm.com/infoce...d/rjvjdapi.htm

    So is the Type4 db2jcc.jar the same as the Type2 Driver. And how can i find the DB2 Universal JDBC Driver? Is it db2java.jar ?

    Thanks for infos.

  2. #2
    Join Date
    Jan 2004
    Posts
    10

    Re: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    com.ibm.db2.jcc.DB2Driver can be used as type 2 or type 4

    The distinction comes beased on the connection URL parameter:

    if the URL pattern is "jdbc:db2://server:port/DB_INSTANCE" it points Type 4

    &

    if the URL pattern is "jdbc"db2:DB_INSTANCE" it points to Type 2.

    -Jeeva

  3. #3
    Join Date
    Nov 2003
    Posts
    30

    Re: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    yeah thanks for pointing that out, but also with Type2 access, i cant get getGeneratedKeys() working. Db2 allways says "JDBC 3 Method not supported yet".

    This is crazy.

    Originally posted by jeeva
    com.ibm.db2.jcc.DB2Driver can be used as type 2 or type 4

    The distinction comes beased on the connection URL parameter:

    if the URL pattern is "jdbc:db2://serverort/DB_INSTANCE" it points Type 4

    &

    if the URL pattern is "jdbc"db2B_INSTANCE" it points to Type 2.

    -Jeeva

  4. #4
    Join Date
    Jan 2004
    Posts
    10

    Re: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    yeah,

    the documentation you had reads:

    In addition to the other forms of execute or executeUpdate, the DB2 Universal JDBC Driver supports the following JDBC 3.0 forms:
    executeUpdate(String sql, int autoGeneratedKeys)
    execute(String sql, int autoGeneratedKeys)


    That means type 2 wouldnt support but type 4 should...


    Dont know why it wouldnt!

    -Jeeva

  5. #5
    Join Date
    Jan 2004
    Posts
    10

    Re: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    Did you make sure that your server version corresponds to that of this documentation?

  6. #6
    Join Date
    Nov 2003
    Posts
    30

    Re: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    No, since my 8.1 is not too old, i thought it must be current.
    But i can check if there are any updates available, just to be sure.

    This is my version:
    Stufe des DB2-Verwaltungstools:
    Produkt-ID SQL08012
    Aktualitäts-ID 02030106
    Level DB2 v8.1.2.169
    Buildlevel s030508
    PTF WR21318



    Originally posted by jeeva
    Did you make sure that your server version corresponds to that of this documentation?
    Last edited by loge; 01-02-04 at 17:29.

  7. #7
    Join Date
    Jan 2004
    Posts
    10

    Re: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    Just in case you havent notices, the documentation seem to refer upto 8.1.4.
    You may to find when exactly JDBC 3.0 support was added.
    I tried to search, but no use..

    Good Luck!

  8. #8
    Join Date
    Nov 2003
    Posts
    30

    Re: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    Yeah, i know. I am just downloading FixPack4, just to be sure thats not a version problem. (cant imagine though)

    Originally posted by jeeva
    Just in case you havent notices, the documentation seem to refer upto 8.1.4.
    You may to find when exactly JDBC 3.0 support was added.
    I tried to search, but no use..

    Good Luck!

  9. #9
    Join Date
    Nov 2003
    Posts
    30

    Re: getGeneratedKeys() [JDBC3.0] with db2jcc.jar Type4

    after upgrading to Fixpack4, getGeneratedKeys() is supported now. I am still using Type4 Universal JDBC driver (db2jcc.jar). The addition was not mentioned in the FIxPack release docs though. Anyway, i am happy that i can proceed...

    Originally posted by loge
    Yeah, i know. I am just downloading FixPack4, just to be sure thats not a version problem. (cant imagine though)

Posting Permissions

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