applicationContext.xml file content <? xml version = "1.0" encoding = "UTF-8"?> <beans xmlns = " " xmlns: xsi = " " xmlns: aop = " " xmlns: tx = " " xsi: schemaLhttp: / / www.springframework.org / schema / beans "> http://www.springframework.org/schema/beans "> <! -- <bean > <property name = "driverClassName" value = "com.mysql.jdbc.Driver"> </ property> <property name="url" value="jdbc:mysql://localhost:3306"> </ property> <property name="username" value="root"> </ property> <property name="password" value="123456"> </ property> </ bean> -> <bean > <property name = "jndiName" value = "jdbc / MysqlPool"> </ property> </ bean> <bean > <property name="dataSource"> <ref bean="dataSuource" /> </ property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </ prop> <prop key="hibernate.show_sql"> true </ prop> </ props> </ property> <property name="mappingResources"> <list> <value> org / agilecc / sd / pojos / User.hbm.xml </ value> </ list> </ property> </ bean> <bean> <property name="sessionFactory"> <ref bean="sessionFactory" /> </ property> </ bean> <bean scope = "prototype"> <property name="userDao"> <ref bean="userDao" /> </ property> </ bean> <bean scope="prototype"> <property name="userService"> <ref bean="userService" /> </ property> </ bean> <bean scope="prototype"> <property name="userService"> <ref bean="userService" /> </ property> </ bean> <bean scope="prototype"> <property name="userService"> <ref bean="userService" /> </ property> </ bean> <bean scope="prototype"> <property name="userService"> <ref bean="userService" /> </ property> </ bean> <bean scope="prototype"> <property name="userService"> <ref bean="userService" /> </ property> </ bean> <bean> <property name="sessionFactory"> <ref local="sessionFactory"/> </ property> </ bean> <tx:advice transaction-manager="transactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED"/> <tx:method name="update*" propagation="REQUIRED"/> <tx:method name="remover*" propagation="REQUIRED"/> <tx:method name="*" read-only="true"/> </ tx: attributes> </ tx: advice> <aop:config> <aop:pointcut expression="execution (* org.agilecc.sd.service.*.*(..))"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod"/> </ aop: config> </ beans> |
Smilar Posts of Spring + Hibernate to use Glassfish Database Connection Pool
-
Servlet brief introduction
Servlet brief introduction: Servlet is a small application server Are used to complete the B / S architecture, the client requests the response to treatment Platform independence, performance, able to ...
-
spring struts2.0 hibernate environmental structures .. despair carried out more than one hour only with good.
http://www.qqread.com/java/2008/06/f413762.html Look here. . Note added myeclipse support spring when necessary add the commons-dbcp database connection pool package. And to add hibernate support. . F ...
-
Spring2.0 + hibernate3.1 + log4j + mysql demo
applicationContext.xml Non-attachment jar package, necessary friends can send an email to todd.liangt @ gmail.com







