getGeneratedKeys() after PreparedStatement.executeBatch()

后端 未结 1 1312
你的背包
你的背包 2021-01-02 00:57

I want to INSERT several rows using a PreparedStatement:

ps = con.prepareStatement(query,PreparedStatement.RETURN_GENERATED_KEYS);
         


        
1条回答
  •  伪装坚强ぢ
    2021-01-02 01:36

    Support for getGeneratedKeys() on batch execution is implementation defined according to the JDBC spec. Most likely the SQL Server driver does not support it for batch execution.

    I tried to look for an explicit statement on the Microsoft site, but couldn't find it. This old (2007) forum post on MSDN does state that it isn't supported: http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/6cbf5eea-e5b9-4519-8e86-f4b65ce3f8e1

    0 讨论(0)
提交回复
热议问题