12 messages in com.mysql.lists.javaRE: returning identity field from a s...| From | Sent On | Attachments |
|---|---|---|
| MHa...@ica.com.au | 15 Jul 2002 19:28 | |
| Jeff Kilbride | 15 Jul 2002 20:44 | |
| Mark Matthews | 15 Jul 2002 20:46 | |
| Tim Endres | 15 Jul 2002 20:56 | |
| Steve Forsyth | 15 Jul 2002 20:57 | |
| Javier Bolaños Molina(MCIC) | 15 Jul 2002 23:20 | |
| Andrew Houghton | 16 Jul 2002 09:23 | |
| Steve Forsyth | 16 Jul 2002 11:20 | |
| Mark Matthews | 16 Jul 2002 12:26 | |
| Jon Frisby | 18 Jul 2002 20:12 | |
| Mark Matthews | 18 Jul 2002 20:55 | |
| Jon Frisby | 19 Jul 2002 11:24 |
| Subject: | RE: returning identity field from a select statement![]() |
|---|---|
| From: | Jon Frisby (jfri...@yourfreedvds.com) |
| Date: | 07/19/2002 11:24:54 AM |
| List: | com.mysql.lists.java |
I see. Perhaps I was thinking of the Perl DBI driver for MySQL then... Thanks for the correction.
-JF
-----Original Message----- From: Mark Matthews [mailto:mmat...@thematthews.org] Sent: Thursday, July 18, 2002 8:55 PM To: Jon Frisby; Jeff Kilbride; ja...@lists.mysql.com; MHa...@ica.com.au Subject: Re: returning identity field from a select statement
----- Original Message ----- From: "Jon Frisby" <jfri...@yourfreedvds.com> To: "Jeff Kilbride" <je...@kilbride.com>; <ja...@lists.mysql.com>; <MHa...@ica.com.au> Sent: Thursday, July 18, 2002 10:12 PM Subject: RE: returning identity field from a select statement
IIRC, getLastInsertID() is a wrapper for "SELECT LAST_INSERT_ID()". Thus, the latter is generally preferrable because you aren't tying
your code to a
particular MySQL JDBC driver...
Not really, because the driver doesn't have to issue a query when you call getLastInsertId() (it's passed back as part of the client-server protocol). Howerver, it is database-specific.
The next version of MM.MySQL will support getGeneratedKeys() fully in all types of Statements, and doesn't require a query to do it (so it's faster than executeQuery("SELECT LAST_INSERT_ID()")).
-Mark
--------------------------------------------------------------------- Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail java...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java...@lists.mysql.com instead.




