如果oracle设置一定时间不访问就会自动关闭连接,这样当java再次访问Oracle的时候就会发生IO异常。解决的方法:在spring配置dataSource中加入如下配置信息.<property name="testConnectionOnCheckout"><value>true</value></property><property name="testConnectionOnCheckin"><value>true</value></property><property name="automaticTestTable"><value>con_test</value></property><property name="checkoutTimeout"><value>30000</value></property><property name="idleConnectionTestPeriod"><value>30</value></property>