No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:tomcat启动正常,报如上错误。该怎么解决!jdbctemplate 不是已经对jdbc进行封装了吗?已经由框架自动管理连接的开启和关闭怎么还会出现如上错误,该怎么解决,高手解答!
解决方案 »
- js三级联动
- 求JasperReport的JRTableModelDataSource数据源的实例
- java远程备份mysql
- 求JBoss Web Server 的JVM配置
- eclipse和myeclipse,tomcat配置问题,
- 关于struts2 表单控件,事件的使用知道的朋友,进来看一下
- ==打搅了,一个在独立tomcat上的servlet如何调用jboss上的ejb,不在乎源码,关键是配置==
- jakarta-tomcat-5.0.27 安装到(using jvm:G;\j2sdk1.4.2_05\..\jvm.dll)就停止安装了。急。。。。
- servlet中调sessionbean出错。
- j2ee的配置问题,我用的是linux
- 高手请进,帮忙看一下连接池的异常
- 求救啊!!!为什么我用post方法向服务器传数据的时候取到的总是为NULL在线等
class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="user">
<value>name</value>
</property>
<property name="password">
<value>password</value>
</property>
<property name="jdbcUrl">
<value>jdbc:oracle:</value>
</property>
<property name="driverClass"><value>oracle.jdbc.driver.OracleDriver</value></property>
<property name="maxPoolSize"><value>1</value></property>
<property name="minPoolSize"><value>1</value></property>
<property name="initialPoolSize"><value>1</value></property>
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"/>
</bean>
这是一段配置jdbcTemplate信息。。
可以定义一个工具类:
package common;import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;import execute.InitApplicationContext;public class JdbcTempleteFactory { static {
if (InitApplicationContext.getAc() == null)
ac = new ClassPathXmlApplicationContext("bean.xml");
else
ac = InitApplicationContext.getAc();
} private static ApplicationContext ac; public static JdbcTemplate getInstance(String name) {
return (JdbcTemplate) ac.getBean(name);
}}
引用:JdbcTempleteFactory.getInstance("jdbcTemplate");