我正在使用play2.5和scala
的应用中使用jooq当我插入一个简单的查询时,驱动程序准备一个带有`围绕表和字段名称的查询,而postgres响应错误,我怎么能克服这个问题,可能有一个驱动程序参数来设置这种行为?
我正在使用
sbt config
libraryDependencies ++= Seq(
jdbc,
cache,
ws,
evolutions,
filters,
"org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0-RC1" % Test,
"org.postgresql" % "postgresql" % "9.2-1003-jdbc4",
"org.jooq" % "jooq" % "3.7.0",
"org.jooq" % "jooq-codegen-maven" % "3.7.0",
"org.jooq" % "jooq-meta" % "3.7.0",
"joda-time" % "joda-time" % "2.7",
"com.adrianhurt" %% "play-bootstrap" % "1.1-P25-B3",
"org.mindrot" % "jbcrypt" % "0.3m"
)
错误:
[debug] 2017-03-12 11:18:52,042 o.j.t.LoggerListener - Executing query : insert into `public`.`user_account` (`nickname`, `email`, `password`, `role`) values (?, ?, ?, ?)
[debug] 2017-03-12 11:18:52,043 o.j.t.LoggerListener - -> with bind values : insert into `public`.`user_account` (`nickname`, `email`, `password`, `role`) values ('', 'simon.cigoj@gmail.com', 'nomis05', 'ROLE_USER')
[error] 2017-03-12 11:18:52,139 o.j.StatementLogger - insert into `public`.`user_account` (`nickname`, `email`, `password`, `role`) values ('', 'aaa@mail.com', 'kjhkh', 'ROLE_USER');
throws exception: org.postgresql.util.PSQLException: ERROR: syntax error at or near "`"
Position: 13
org.postgresql.util.PSQLException: ERROR: syntax error at or near "`"
Position: 13
答案 0 :(得分:2)
看起来您没有设置正确的SQLDialect
,例如
SQLDialect.POSTGRES_9_5