我正在尝试通过play(1.2.4)+mysql优化批量插入。我看到一些帖子在讨论将以下内容添加到jdbc配置中(将其添加到连接字符串中):useServerPrepStmts=false&rewriteBatchedStatements=true&useCompression=true
我试过这样做:
db=mysql://root@localhost/data?useServerPrepStmts=false&rewriteBatchedStatements=true&useCompression=true但是我得到了这个错误:
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://....
还是不走运。我遗漏了什么?
发布于 2012-08-16 17:26:51
播放会自动在MySQL连接字符串后附加以下内容:
?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci所以我猜你的连接字符串最终是无效的,因为现在有两组参数(以问号开始)。
不幸的是,播放代码的这一部分在DBPlugin类中是非常硬编码的,这意味着您不能以这种方式添加选项。您将不得不在以后的阶段中寻找一种方法来更改选项。
https://stackoverflow.com/questions/11644877
复制相似问题