Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

[JDBC] Retrieving last InsertedID : INSERT... RETURNING safe ?

From: <spastor(at)motionsponsor.com>
Date: Wed Feb 20 2008 - 04:44:37 EST


 Hello everyone,

This is my very first POST in this list. I am just starting to work with postgresql and the jdbc driver and so far so good ! Only one exception is regarding the best method to retrieve the last inserted id (serial). There are many posts on this topic but i couldn t find a definitive response. I am using postgresql version 8.2.6 and jdbc 8.2_p505, i ve been experiencing INSERT statement with RETURNING myID, using an executeQuery it works great, i retrieve the proper value everytime at least from the few tests i have been doin locally. Is it THAT easy or could this method break somehow in a live environement ? If yes could you advise on another method ?

Thanks in advance

Sebastien.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly
Received on Wed Feb 20 04:51:19 2008

This archive was generated by hypermail 2.1.8 : Wed Jun 18 2008 - 23:45:02 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library