【发布时间】:2014-07-08 10:02:43
【问题描述】:
我将 Play Framework (2.3.1) 与 Slick(play-slick 版本 0.8.0-M1)和 MySQL 数据库 (5.5.28) 一起使用。
我的一个查询导致 MySQLSyntaxErrorException:
Preparing statement: select x2."id", x2."course_id", x2."trainee_id", x2."transaction_id" from "trainee_grouptraining_GroupBooking" x2 where x2."course_id" = 1
问题似乎与双引号有关,因为其他查询工作正常并且它们使用单引号,如下所示:
Preparing statement: select x2.`id`, x2.`courseLanguage`, x2.`date`, x2.`description`, x2.`duration`, x2.`kind`, x2.`maxParticipants`, x2.`name`, x2.`courseType_id`, x2.`trainer_id` from `Course` x2 where x2.`id` = 1
我该怎么办?
【问题讨论】:
-
你在使用类型安全的 api 吗?您的驱动程序设置可能有问题。你在投射什么吗?
-
我没有强制转换,我不确定你所说的类型安全 api 是什么意思。你能告诉我如何找出驱动程序设置是否有问题吗?这是在我的 application.conf 中: db.default.driver=com.mysql.jdbc.Driver db.default.url="jdbc:mysql://localhost/sportify_dev" db.default.user=root db.default.password =""
-
能否在 github 上提供一个能重现问题的最小示例项目?
标签: mysql playframework playframework-2.0 slick play-slick