【问题标题】:Migration to Mysql Connector Jar 5.1.27迁移到 Mysql 连接器 Jar 5.1.27
【发布时间】:2013-11-21 13:17:56
【问题描述】:

我刚刚将我的 mysql 连接器 jar 3.1.12 替换为 5.1.27。 并得到错误

您需要将 Statement.RETURN_GENERATED_KEYS 指定给 Statement.executeUpdate() 或 Connection.prepareStatement()。

我得到了我应该使用的解决方案

PreparedStatement ps = connection.prepareStatement(SQL, Statement.RETURN_GENERATED_KEYS);

改为

PreparedStatement ps = connection.prepareStatement(SQL); 

主要问题是如何在整个项目中替换它,有什么方法可以全局设置它吗?

我应该记住 5.1.27 版本的其他问题吗?

【问题讨论】:

    标签: java mysql jdbc mysql-connector


    【解决方案1】:

    这个缺陷已经提交给 MYSQL 团队,他们已经在 5.1.8 版本中修复了这个问题。但是这个问题对于最新版本仍然存在。到目前为止,这还没有解决。 请参阅以下链接以获取更多信息 -

    http://bugs.mysql.com/bug.php?id=41448

    连接器 J 5.1.8 - 工作 连接器 J 5.1.10 - 不工作 连接器 J 5.1.18 - 不工作 连接器 J 5.1.21 - 不工作

    【讨论】:

      猜你喜欢
      • 2016-11-28
      • 1970-01-01
      • 2012-11-26
      • 1970-01-01
      • 1970-01-01
      • 2016-10-17
      • 1970-01-01
      • 2012-09-04
      • 2019-07-31
      相关资源
      最近更新 更多