tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@swapsimple.com
Subject Re: method level synchronization doesn't work
Date Fri, 01 Oct 2004 15:09:25 GMT
On Fri, Oct 01, 2004 at 04:05:53PM +1200, jthompson@honda.co.nz 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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message