开发者社区> 问答> 正文

Jfinal 使用 druid 配置 oracle报错 :报错

在Jfinal中,使用druid配置oracle报错

//连接池插件
		DruidPlugin druidPluginOracle = new DruidPlugin(
				getProperty("db.oracle.jdbcUrl"),
				getProperty("db.oracle.user"),
				getProperty("db.oracle.password")
				);
		druidPluginOracle.setDriverClass(getProperty("db.oracle.driver"));
		me.add(druidPluginOracle);
		
		ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPluginOracle);
		me.add(arp);
		arp.setDialect(new OracleDialect());
		
		arp.setContainerFactory(new CaseInsensitiveContainerFactory());
		
		arp.addMapping("stat_sys_menu","ID", MenuModel.class);



报错:

三月 16, 2015 10:14:52 下午 com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl error
严重: invalid oracle validationQuery. select 1, may should be : select 1 FROM DUAL
三月 16, 2015 10:14:53 下午 com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl error
严重: init datasource error, url: jdbc:oracle:thin:@localhost :1521:NWZTJC
java.sql.SQLSyntaxErrorException: ORA-00923: 未找到要求的 FROM 关键字


at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:221)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:118)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:224)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:468)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:418)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1085)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:188)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:1005)
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:1112)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1472)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1736)
at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:1278)
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1229)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1439)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:934)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:930)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:102)
at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:36)
at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:171)
at com.jfinal.core.Config.startPlugins(Config.java:87)
at com.jfinal.core.Config.configJFinal(Config.java:48)
at com.jfinal.core.JFinal.init(JFinal.java:67)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:277)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.jfinal.server.JettyServer.doStart(JettyServer.java:120)
at com.jfinal.server.JettyServer.start(JettyServer.java:64)
at com.jfinal.core.JFinal.main(JFinal.java:181)


谢谢

展开
收起
kun坤 2020-06-14 15:35:23 879 0
1 条回答
写回答
取消 提交回答
  • druidPluginOracle.setValidationQuery("select 1 from dual");######druid哪个版本,oracle哪个版本

    2020-06-14 15:35:29
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
PostgresChina2018_樊文凯_ORACLE数据库和应用异构迁移最佳实践 立即下载
PostgresChina2018_王帅_从Oracle到PostgreSQL的数据迁移 立即下载
Oracle云上最佳实践 立即下载

相关镜像