开发者

PreparedStatement getGeneratedKeys() JDBC

开发者 https://www.devze.com 2023-02-14 11:21 出处:网络
i used getGeneratedKeys after inserting in B开发者_StackOverflow社区atchmode. I presume that the order i with the keys are returned is the same as the inserts in my batched insert statments. I want to

i used getGeneratedKeys after inserting in B开发者_StackOverflow社区atchmode. I presume that the order i with the keys are returned is the same as the inserts in my batched insert statments. I want to use the keys as foreign keys in an other table and need to map the data to the foreign key.

  1. Is this correct? The API doesn't say anything about the order... :-(
  2. What happens if I do "insert ignore", do I have to calulate the offset from the executeBatch()-Function? Or is there an easier way to map generated keys and inserted data in my java app?

Thanks soooo much guys. I'm happy for any hint.

0

精彩评论

暂无评论...
验证码 换一张
取 消