问题描述
大家好,我现在在项目中使用了hibernate来连接数据库,使用到的连接池是proxool,但奇怪的是,在tomcat的日志中,每隔一定时间就会出现以下信息:09:02:35,768 DEBUG fm_oracleproxool:431 - 009441 (00/09/00) - #7920 removed because it has problems: java.sql.SQLException: ORA-00923: 未找到要求的 FROM 关键字09:02:36,407 DEBUG fm_oracleproxool:181 - 009441 (00/10/00) - Connection #7939 created to achieve minimum of 10 = AVAILABLE 不过程序运行目前没有发现有问题,不知这是什么原因呢?是否应该解决,应该如何解决?谢谢大家~~~ 以下是proxool的配置信息:<proxool> <alias>fm_oracleproxool</alias> <driver-url>jdbc:oracle:thin:xx:xx</driver-url> <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> <driver-properties> <property name="user" value="xx" /> <property name="password" value="xx" /> </driver-properties> <house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql> <house-keeping-sleep-time>90000</house-keeping-sleep-time> <simultaneous-build-throttle>20</simultaneous-build-throttle> <maximum-connection-count>100</maximum-connection-count> <minimum-connection-count>10</minimum-connection-count> <maximum-connection-lifetime>3600000</maximum-connection-lifetime> </proxool>
解决方案
<house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql> proxool 连接测试语句有问题。<house-keeping-test-sql>select form CURRENT_DATE</house-keeping-test-sql>
解决方案二:
<?xml version="1.0" encoding="UTF-8"?><!-- the proxool configuration can be embedded within your own application's.Anything outside the "proxool" tag is ignored. --><proxool><alias>btsvrPool</alias><driver-url>jdbc:mysql://localhost:3306/btsvr?autoReconnect=true&useUnicode=true&characterEncoding=iso8859_1</driver-url><driver-class>com.mysql.jdbc.Driver</driver-class><driver-properties><property name="user" value="root" /><property name="password" value="123456" /></driver-properties><minimum-connection-count>2</minimum-connection-count><maximum-connection-count>20</maximum-connection-count><maximum-connection-lifetime>180000</maximum-connection-lifetime><!-- 5 hours --><house-keeping-test-sql>values(current TimeStamp)</house-keeping-test-sql><statistics>1m,15m,1d</statistics><statistics-log-level>WARN</statistics-log-level><fatal-sql-exception>Connection is closed,SQLSTATE=08003,Error opening socket.SQLSTATE=08S01,SQLSTATE=08S01</fatal-sql-exception><fatal-sql-exception-wrapper-class>org.logicalcobwebs.proxool.FatalRuntimeException</fatal-sql-exception-wrapper-class><verbose>false</verbose></proxool>之前我再做一个项目时使用的proxool的配置文件,可以参考一下。
解决方案三:
引用house-keeping-test-sql>select from CURRENT_DATE</house-keeping-test-sql>
解决方案四:
出现这个问题是在你写的sql语句上。一般都在查询表的头几条信息的时候会用top,而这个关键字在sql server中支持,在oracel中是不支持的。Oracle不支持TOP N 查询方式,需要用order by和rownum结合实现。