• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Retrieving auto-assigned index from inserted record

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A common database feature is the automatic assignment of a unique index for a newly inserted record (e.g. AutoNumber in MS Access). But, immediately following the insertion, how through JDBC can I retrieve that index?
What might work is to insert via ResultSet.insertRow(), and then read back the index field from that row while that ResultSet is still alive. Unfortunately, my experiments on this have been hampered because of limitations of the JDBC-ODBC bridge driver, which is a separate issue. Anyway, that technique works in other environments, like MS ADO. Does it work here? Are there other techniques that work?
 
reply
    Bookmark Topic Watch Topic
  • New Topic