首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用play、hibernate和mysql更改rewriteBatchedStatements

使用play、hibernate和mysql更改rewriteBatchedStatements
EN

Stack Overflow用户
提问于 2012-07-25 15:39:52
回答 1查看 1.4K关注 0票数 0

我正在尝试通过play(1.2.4)+mysql优化批量插入。我看到一些帖子在讨论将以下内容添加到jdbc配置中(将其添加到连接字符串中):useServerPrepStmts=false&rewriteBatchedStatements=true&useCompression=true

我试过这样做:

代码语言:javascript
复制
db=mysql://root@localhost/data?useServerPrepStmts=false&rewriteBatchedStatements=true&useCompression=true

但是我得到了这个错误:

代码语言:javascript
复制
A database error occured : Cannot connected to the database, The connection property 'useCompression' only accepts values of the form: 'true', 'false', 'yes' or 'no'. The value 'true?useUnicode=yes' is not in this set.

我还尝试使用db=jdbc:mysql://....

还是不走运。我遗漏了什么?

EN

回答 1

Stack Overflow用户

发布于 2012-08-16 17:26:51

播放会自动在MySQL连接字符串后附加以下内容:

代码语言:javascript
复制
?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci

所以我猜你的连接字符串最终是无效的,因为现在有两组参数(以问号开始)。

不幸的是,播放代码的这一部分在DBPlugin类中是非常硬编码的,这意味着您不能以这种方式添加选项。您将不得不在以后的阶段中寻找一种方法来更改选项。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11644877

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档