解决方案 »
- java有关
- jsp 订单跟踪代码编写
- eclipse开发的web项目在MyEclipse上不能部署到tomcat上
- 求解答...关于Spring+Ibatis 重点是 如果再使用proxool配置数据源.
- 初级问题,请高手帮助。
- 聊天室的最大连接数能有多少
- 客户已经有了域名,JSP网站该如何发布?急!!
- 一个让我郁闷一个晚上的问题:jdbc连接sql server数据库的问题!
- 请各位帮我看一下这段代码,帮我一把!!!与数据虚联接的语句问题!!!!
- redhat9.0下APACHE2.X与TOMCAT整合问题,很怪异
- myeclipse中创建web项目无法访问一直出现400错误
- Jstl set 对象,不能获得属性,求解!
查查看哪地方关的
<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的所有配置文件 前辈帮忙看一下 谢谢了