Spring之DBCP连接池注入实例

来源:互联网 发布:带vga接口的网络机顶盒 编辑:程序博客网 时间:2024/05/01 21:20
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"><property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property><property name="url"><value>jdbc:mysql://localhost:3306/mytest1</value></property><property name="username"><value>root</value></property><property name="password"><value>123</value></property></bean><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"><property name="dataSource"><ref bean="dataSource"/></property></bean><bean id="helloDao" class="com.gc.action.HelloDao"><property name="dataSource"><ref bean="dataSource"/></property><!-- <property name="transactionManager"><ref bean="transactionManager"/></property> --></bean><bean id="helloDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"><property name="transactionManager"><ref bean = "transactionManager"/></property><property name="target"><ref bean="helloDao"/></property><property name="transactionAttributes"><props><prop key="create*">PROPAGATION_REQUIRED</prop></props></property></bean> 
0 0
原创粉丝点击