Hi!
I have a problems using a serial type field in a table with the jdbc postgres driver.
Table:
create table dummy_user (
id serial primary key,
name text
)
Now I would like to insert a new row into this table.
{
String name="Hugo";
PreparedStatement ps=db.prepareStatement("INSERT INTO dummy_user (name) values (?)");
ps.setString(1,name);
ps.executeUpdate();
ps.close();
db.commit();
}
works just fine. The problem is: I could not yet find a way to get the value of the field "id" of my newly inserted
row.I tried it with an UpdatableResultSet (which should work in theory), but it is not yet implemented. I searched a
lotof mailinglists, but could not find a solution either.
I would be very thankful for any comments helping me solve this problem,
yours,
Christoph
--
eulox.net, Wien
software-engineer
christoph.jaeger@eulox.net