解决方案 »

  1.   

    提示的很清楚了啊,当前 statement 已被关掉,但你还在想对其进行操作。
    查查看哪地方关的
      

  2.   

    我也没找到具体产生原因的地方 上面就是数据库所有的连接和log了 往前辈帮忙
      

  3.   

    打断点或者 log 跟一下啊,肉眼看费劲了
      

  4.   

    statement关闭后,又进行操作。你这里代码没体现出来,找下你操作statement的地方
      

  5.   

     No operations allowed after statement closed找找看看  已经关闭了。
      

  6.   

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-2.5.xsd
               http://www.springframework.org/schema/aop
               http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
               http://www.springframework.org/schema/tx 
               http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    <context:annotation-config />
    <context:component-scan base-package="com.wds" />
    <context:component-scan base-package="com.jmy" />
    <!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" 
    destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" 
    /> <property name="url" value="jdbc:mysql://localhost:3306/spring" /> <property 
    name="username" value="root" /> <property name="password" value="bjsxt" /> 
    </bean> --> <bean
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
    <value>classpath:jdbc.properties</value>
    </property> </bean> <bean id="dataSource" destroy-method="close"
    class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="${jdbc.driverClassName}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    <property name="maxActive" value="100" />
    <property name="maxIdle" value="30" />
    <property name="maxWait" value="1000" />
    <property name="defaultAutoCommit" value="true" />
    <property name="removeAbandoned" value="true" />
    <property name="removeAbandonedTimeout" value="60" /> 
    <!-- --> </bean> <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" />
    <property name="packagesToScan">
    <list>
    <value>com.wds.registration.model</value>
    <value>com.jmy.essay.model</value>
    <value>com.jmy.picture.model</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    org.hibernate.dialect.MySQLDialect
    </prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.hbm2ddl.auto">update</prop> </props>
    </property>
    <!--  <property name="connection.autoReconnect" value="true" />
    <property name="connection.autoReconnectForPools" value="true" />
    <property name="connection.is-connection-validation-required"
    value="true" />
    <property name="hibernate.dbcp.maxWait" value="-1" />
    <property name="hibernate.dbcp.maxIdle" value="-1" />
    <property name="hibernate.dbcp.validationQuery" value="select 1" />
    <property name="hibernate.dbcp.testOnBorrow" value="true" /> --> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
    <property name="sessionFactory" ref="sessionFactory"></property> </bean><!-- <bean id="jelogic" class="com.jmy.logic.JEssayLogic"> <property 
    name="sessionFactory" ref="sessionFactory"></property> </bean> -->
    <bean id="txManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>
    <aop:config proxy-target-class="true"></aop:config> <tx:advice id="txAdvice" transaction-manager="txManager">
    <tx:attributes>
    <tx:method name="exists" read-only="true" />
    <tx:method name="add*" propagation="REQUIRED" />
    </tx:attributes>
    </tx:advice></beans>关键是我用的hibernate, 没有操作过statement这个东西 上面是我bean.xml的所有配置文件 前辈帮忙看一下 谢谢了 
      

  7.   

    我用的hibernate的 没有写过涉及到statement的代码 xml配置文件已经发到上面了 
      

  8.   

    我之前也这样,用的ssh框架, 然后重启下项目就可以了具体底层的我不懂