ActiveRecordPlugin 不能使用 PostgreSQL 数据库兼容有bug,无法正常使用。求助有解决办法吗?
关键代码
testdb { main(String[] args) { DruidPlugin dp = DruidPlugin(, , ); ActiveRecordPlugin arp = ActiveRecordPlugin(dp); arp.addMapping(, LiangjianUser.); dp.start(); arp.start(); System..println(); } }
报错信息
com.lj.hikvision.service.testdb
12:48:12.664 [main] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
Can not create Table object, maybe the table liangjiantable is not exists.
Exception in thread "main" com.jfinal.plugin.activerecord.ActiveRecordException: org.postgresql.util.PSQLException: ERROR: syntax error at or near "`"
位置:15
at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:55)
at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:226)
at com.lj.hikvision.service.testdb.main(testdb.java:34)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "`"
位置:15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:231)
at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:297)
at com.jfinal.plugin.activerecord.TableBuilder.doBuild(TableBuilder.java:71)
at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:47)
... 2 more
进程已结束,退出代码 1
错误定位 是 执行 arp.start(); 后报错 Can not create Table object, maybe the table liangjiantable is not exists.
表在数据库里是有的 并且直接使用jdbc连接 测试是 好的,所以估计是ActiveRecordPlugin 。
此程序连接mysql 是好的 就是连接PostgreSQL 数据库报错,求助有解决办法吗?我换了几个低版本的也报同样的错