2
回答
Jfinal 使用 druid 配置 oracle报错
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

在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)


谢谢

举报
IT游民
发帖于3年前 2回/3K+阅
顶部