P
Peter Plumber
String sql = "INSERT INTO parameters" +
" (id, task_id, element_identifier," +
" element_property, property_value) " +
" VALUES ( nextval('parameters_id_seq'::regclass)" +
", '" + taskID + "', 'this', '" + parameterName +
"', '" + parameterValue + "')";
// the INSERT succeeds (PostgreSQL 8.1.1)
Statement st = connect();
st.executeUpdate(sql);
st.getConnection().close();
// but I would like to retrieve the new ID value
// created by the SEQUENCE-Function
// error description: Returning autogenerated keys is not supported.
Statement st = connect();
st.execute(sql, Statement.RETURN_GENERATED_KEYS);
ResultSet insertedKeys = st.getGeneratedKeys();
st.getConnection().close();
Any ideas how to get around this problem
is there a jdbc way to do this
thanx
Peter
" (id, task_id, element_identifier," +
" element_property, property_value) " +
" VALUES ( nextval('parameters_id_seq'::regclass)" +
", '" + taskID + "', 'this', '" + parameterName +
"', '" + parameterValue + "')";
// the INSERT succeeds (PostgreSQL 8.1.1)
Statement st = connect();
st.executeUpdate(sql);
st.getConnection().close();
// but I would like to retrieve the new ID value
// created by the SEQUENCE-Function
// error description: Returning autogenerated keys is not supported.
Statement st = connect();
st.execute(sql, Statement.RETURN_GENERATED_KEYS);
ResultSet insertedKeys = st.getGeneratedKeys();
st.getConnection().close();
Any ideas how to get around this problem
is there a jdbc way to do this
thanx
Peter