Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:09:11+00:00 2026-05-26T01:09:11+00:00

It looks like Firebird does NOT support getGeneratedKeys() after you perform an insert with

  • 0

It looks like Firebird does NOT support getGeneratedKeys() after you perform an insert with an auto_increment column. So I would like to understand how I can get my hands on the generated key after an insert.

1) Do I have to use “insert into users(…) values(…) returning id” and call this through a CallableStatement in order to get the generated ID? How exactly? Do I need to wrap my insert around a “call { … }”

2) Is there some other way of getting the generated id under Firebird, some kind of “select last_id_generated()”. “select max(id) from users” does not count.

3) Is it really true that getGeneratedKeys() is not supported by Firebird JDBC driver? (optional)

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:09:11+00:00Added an answer on May 26, 2026 at 1:09 am

    It turns out that all you have to do is call the “insert … returning” with executeQuery (from PreparedStatement) instead of executeUpdate. That will return your ResultSet from where you can get the generated id. I never thought that you could call an INSERT with executeQuery. I thought you had to do executeUpdate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looks like libxslt does not support XSLT 2.0, and xsl:result-document . Is there a
Update : Looks like the query does not throw any timeout. The connection is
Looks like my shared hosting plan does not cover running a Jabber server. Does
Looks like set does not work in velocity when written as below : #set
Looks like the following Ellipse in ControlTemplate does not get the BorderThickness, but why?
It looks like callback function is executed right after animate is called, not at
looks like symfony2 classloader does not allow different paths for namespaces, anyone has any
Looks like XSD.exe is not delivered as a part of Visual Studio 2010. what
It looks like we'll be adding CAPTCHA support to Stack Overflow. This is necessary
Looks like I've missed something obvious but really can't figure out why I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.