----- 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