@JFinal 波总 用sql查一张表是否存在时报错,之前的项目可以用的啊

yuzhibin 发布于 2019/05/16 10:51
阅读 374
收藏 0

sql:select * from information_schema.TABLES where TABLE_SCHEMA=(select database()) and `table_name` ='your table'

报错:

com.jfinal.plugin.activerecord.ActiveRecordException: java.lang.UnsupportedOperationException: Cannot support SQL for `schema.table`
    at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:329)
    at com.jfinal.plugin.activerecord.DbPro.findFirst(DbPro.java:355)
    at com.jfinal.plugin.activerecord.DbPro.findFirst(DbPro.java:364)
    at com.jfinal.plugin.activerecord.Db.findFirst(Db.java:301)
    at com.ymm.project.model.examine.Examine.getTableNames(Examine.java:94)
    at com.ymm.project.model.examine.Examine.adopt(Examine.java:64)
    at com.ymm.project.controller.examine.ExamineController.adopt(ExamineController.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:75)
    at com.jfinal.core.ActionHandler.handle(ActionHandler.java:81)
    at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsupportedOperationException: Cannot support SQL for `schema.table`
    at io.shardingjdbc.core.parsing.parser.clause.TableReferencesClauseParser.parseTableFactor(TableReferencesClauseParser.java:67)
    at io.shardingjdbc.core.parsing.parser.dialect.mysql.clause.MySQLTableReferencesClauseParser.parseTableReference(MySQLTableReferencesClauseParser.java:24)
    at io.shardingjdbc.core.parsing.parser.clause.TableReferencesClauseParser.parse(TableReferencesClauseParser.java:54)
    at io.shardingjdbc.core.parsing.parser.sql.dql.select.AbstractSelectParser.parseTable(AbstractSelectParser.java:109)
    at io.shardingjdbc.core.parsing.parser.sql.dql.select.AbstractSelectParser.parseFrom(AbstractSelectParser.java:98)
    at io.shardingjdbc.core.parsing.parser.dialect.mysql.sql.MySQLSelectParser.parseInternal(MySQLSelectParser.java:50)
    at io.shardingjdbc.core.parsing.parser.sql.dql.select.AbstractSelectParser.parseInternal(AbstractSelectParser.java:81)
    at io.shardingjdbc.core.parsing.parser.sql.dql.select.AbstractSelectParser.parse(AbstractSelectParser.java:68)
    at io.shardingjdbc.core.parsing.parser.sql.dql.select.AbstractSelectParser.parse(AbstractSelectParser.java:46)
    at io.shardingjdbc.core.parsing.SQLParsingEngine.parse(SQLParsingEngine.java:50)
    at io.shardingjdbc.core.routing.router.ParsingSQLRouter.parse(ParsingSQLRouter.java:74)
    at io.shardingjdbc.core.routing.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:55)
    at io.shardingjdbc.core.jdbc.core.statement.ShardingPreparedStatement.route(ShardingPreparedStatement.java:150)
    at io.shardingjdbc.core.jdbc.core.statement.ShardingPreparedStatement.executeQuery(ShardingPreparedStatement.java:115)
    at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:314)
    at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:327)
    ... 32 more

加载中
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部