0

I have insert query that works, but I can't get ID of created row in return. How can I achieve that? having this:

conn = Java::JavaSql::DriverManager.getConnection(url)
st = conn.create_statement
rs = st.execute_update(query)

How can I get id?

Konrad Janczyk
  • 182
  • 2
  • 12

1 Answers1

1

more of a JDBC question that depends on the DB/driver used.

generally st.generated_keys gives you a result set of the IDs

also read: How to get the insert ID in JDBC?

Community
  • 1
  • 1
kares
  • 7,076
  • 1
  • 28
  • 38