I've noticed that everything works as expected if I use:
connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
Unfortunately, this code does not work with Oracle, which is why I started testing the other version (the one with the specified column names). After this discussion, I can't think of any solution other than maintaining two version of my piece of code: one for Oracle, and one PostgreSQL, as I don't see Oracle changing their driver either. :-) It's not a really big deal.
Thanks.
On 15/07/2016 16:58, David G. Johnston wrote:
--
Andrea Bergia
List S.p.A.