开发者

PreparedStatement getGeneratedKeys() JDBC

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜