c3p0配置例子

来源:互联网 发布:婚礼录像后期软件 编辑:程序博客网 时间:2024/05/18 03:01
<context:property-placeholder location="classpath:c3p0.properties"/>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${driverClassName}"></property>
<property name="jdbcUrl" value="${url}"></property>
<property name="user" value="${username}"></property>
<property name="password" value="${password}"></property>
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>

<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">${ShowSql}</prop>
<prop key="hibernate.dialect">${dialect}</prop>
</props>
</property>

<property name="mappingResources">
<list>
<value>com/pk/po/Loginfo.hbm.xml</value>
<value>com/pk/po/Userinfo.hbm.xml</value>
</list>
</property>
</bean>
<!--

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>

<tx:advice id="HAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="find*" propagation="REQUIRED" isolation="READ_COMMITTED" read-only="true"/>
<tx:method name="*" propagation="REQUIRED" isolation="READ_COMMITTED"/>
</tx:attributes>
</tx:advice>

<aop:config >
<aop:pointcut id="curd" expression="execution (* com.pk.service..*.*(..))"/>
<aop:advisor advice-ref="HAdvice" pointcut-ref="curd"/>
</aop:config>
-->
复制搜索
原创粉丝点击