Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

postgresql - How to fix -Returning autogenerated keys is not supported. exception

 
Manoj Raghuwanshi
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using postgresql database. I using sequence as a primary key in a table.
After inserting a row using preparedStatement, I want to know this auto generated id. For this i am using the jdbc 3 method ,
pstmt = conn.prepareStatement(query,
Statement.RETURN_GENERATED_KEYS);

But the postgresql driver is throwing this exception -
Returning autogenerated keys is not supported.
please help me to fix this problem.Thanks in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic