sequence problems

Поиск
Список
Период
Сортировка
От Christoph Jaeger
Тема sequence problems
Дата
Msg-id 20010404173042.A23586@eulox.net
обсуждение исходный текст
Список pgsql-jdbc
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

Вложения

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Heather Grace"
Дата:
Сообщение: where to find most recent jdbc driver
Следующее
От: Gabriel García
Дата:
Сообщение: How connect JDBC