C3P0数据源 连接Access数据库

  1. xml version="1.0" encoding="UTF-8"?>  
  2. <beans xmlns="http://www.springframework.org/schema/beans"  
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  4.     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">  
  5.        
  6.       
  7.     <bean id="dataSource"  
  8.         class="com.mchange.v2.c3p0.ComboPooledDataSource"  
  9.         destroy-method="close">  
  10.           
  11.         <property name="driverClass" value="com.hxtt.sql.access.AccessDriver" />  
  12.           
  13.         <property name="jdbcUrl"  
  14.             value="jdbc:access:///c:/你的Access的绝对路径" />  
  15.           
  16.         <property name="user" value="" />  
  17.           
  18.         <property name="password" value="" />  
  19.           
  20.         <property name="maxPoolSize" value="40" />  
  21.           
  22.         <property name="minPoolSize" value="10" />  
  23.           
  24.         <property name="initialPoolSize" value="10" />  
  25.           
  26.         <property name="maxIdleTime" value="3" />  
  27.     bean>  
  28.       
  29.     <bean id="sessionFactory"  
  30.         class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">  
  31.         <property name="dataSource" ref="dataSource" />  
  32.           
  33.         <property name="hibernateProperties">  
  34.             <props>  
  35.                   
  36.                 <prop key="hibernate.dialect">  
  37.                     com.hxtt.support.hibernate.HxttAccessDialect                prop>  
  38.                 <prop key="show_sql">falseprop>  
  39.                 <prop key="hibernate.hbm2ddl.auto">updateprop>  
  40.                   
  41.                 <prop key="hibernate.jdbc.batch_size">30prop>  
  42.             props>  
  43.         property>  
  44.         <property name="mappingResources">  
  45.               
  46.             <list>  
  47.                 <value>XXXX.hbm.xmlvalue>  
  48.                    
  49.             list>  
  50.         property>  
  51.     bean>  
  52.       
  53.     <bean id="transactionManager"  
  54.         class="org.springframework.orm.hibernate3.HibernateTransactionManager">  
  55.           
  56.         <property name="sessionFactory" ref="sessionFactory" />  
  57.     bean>  
  58.       
  59.     <bean id="transactionInterceptor"  
  60.         class="org.springframework.transaction.interceptor.TransactionInterceptor">  
  61.           
  62.         <property name="transactionManager" ref="transactionManager" />  
  63.         <property name="transactionAttributes">  
  64.               
  65.             <props>  
  66.                 <prop key="save*">PROPAGATION_REQUIREDprop>  
  67.                 <prop key="get*">PROPAGATION_REQUIRED,readOnlyprop>  
  68.                 <prop key="find*">PROPAGATION_REQUIRED,readOnlyprop>  
  69.                 <prop key="*">PROPAGATION_REQUIREDprop>  
  70.             props>  
  71.         property>  
  72.     bean>  
  73.   
  74.       
  75.     <bean  
  76.         class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">  
  77.           
  78.         <property name="beanNames">  
  79.               
  80.             <list>  
  81.                 <value>*Daovalue>  
  82.                 <value>*Impvalue>  
  83.                    
  84.             list>  
  85.               
  86.         property>  
  87.           
  88.         <property name="interceptorNames">  
  89.             <list>  
  90.                   
  91.                 <value>transactionInterceptorvalue>  
  92.             list>  
  93.         property>  
  94.     bean>  
  95.   
  96.       
  97.     <bean id="xxxxDao" class="org.boss.dao.XxxxDaoHibernate">  
  98.           
  99.         <property name="sessionFactory" ref="sessionFactory">property>  
  100.     bean>  
  101.       
  102.     <bean id="xxxxImp" class="org.boss.service. XxxxManagerImp">  
  103.         <property name="xxxxDao" ref="xxxxDao">property>  
  104.     bean>      
  105. beans>  

晕,发现要收费的。。。。火死了。。。。。。。。。。。。 

 

来自:http://wxinpeng.javaeye.com/blog/203093

 

 

你可能感兴趣的:(c3p0,access,数据库连接池,hibernate,数据库,bean)