Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    8

    Unanswered: Postgresql.getGeneratedKeys()

    Hi to all,

    I have one problem with PostgreSQL and Java,
    into one table I have set the primary key how bigserial (auto_increment), but after insert I am unable to retrieve the value insert by DB, because the getGeneratedKeys() method isn't implemented in postgresql-jdbc driver.

    There is another method to retrieve this field?

    thanks
    Stefano

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400
    did you operate with a sequence

    then use a this

    Select nextval('sequence')
    returns the next value of the sequence
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    Jun 2004
    Posts
    8
    Perfect!

    Thanks for the solution!

Posting Permissions

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