0

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://... も使用しようとしました。

まだ運がありません。私は何が欠けていますか?

4

1 に答える 1

0

Play は、MySQL 接続文字列に以下を自動的に追加します。

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

そのため、2 つのパラメーター セット (疑問符で始まる) があるため、接続文字列が無効になると推測しています。

残念ながら、Play コードのその部分は DBPlugin クラスでかなりハードコーディングされているため、そのようにオプションを追加することはできません。後の段階でオプションを変更する方法を探す必要があります。

于 2012-08-16T09:26:51.403 に答える