mysql definitely supports retrieval of generated keys through jdbc.

http://dev.mysql.com/tech-resources/articles/autoincrement-with-connectorj.h
tml


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Friday, October 01, 2004 10:09 AM
> To: [EMAIL PROTECTED]
> Cc: Tomcat Users List
> Subject: Re: method level synchronization doesn't work
> 
> 
> On Fri, Oct 01, 2004 at 04:05:53PM +1200, [EMAIL PROTECTED] wrote:
> > Is your primary key generated automatically?
> > If so, the combined insert/query is:
> > 
> >            String stmt="INSERT INTO SOMEFILE (FLD1,FLD2,FLD3) 
> > VALUES(?,?,?)";
> >            PreparedStatement sql = 
> > conn.prepareStatement(stmt,Statement.RETURN_GENERATED_KEYS);
> 
>       Does mysql actually support this?  I know postgresql 
> does not support returning generated keys, but I was able to 
> work around it by tacking a select from the sequence 
> immediately after the insert: e.g. "insert into foo ... ; 
> select currval('foo_keyfield_seq');" Is postgres just behind 
> the times?
> 
> eric
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to