2012-07-25 39 views
0

我想通过播放(1.2.4)+ MySQL优化批量插入。 我看到一些帖子谈论加入以下JDBC配置(将其添加到连接字符串):useServerPrepStmts =假& rewriteBatchedStatements =真& useCompression =真改变rewriteBatchedStatements与播放,休眠和MySQL

我试图做的事:

db=mysql://[email protected]/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的:// ....

仍然没有运气。 我错过了什么?

回答

0

播放自动将MySQL连接字符串有以下:

?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci 

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

不幸的是,Play代码的那部分在DBPlugin类中是相当硬编码的,这意味着您不能以这种方式添加选项。您将不得不寻找一种方法在后期改变选项。