spring/applicationContext-dao.xml

(完整代码) 2KB

<?xml version="1.0" encoding="UTF-8"?>
<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"
    xsi:schemaLocation="
    	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

        
     <!-- 读取指定资源文件 -->
     <context:property-placeholder location="classpath:db.properties"></context:property-placeholder>
      
     <!-- 配置数据源   交给spring容器管理 -->
     <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
     	<property name="driverClass" value="${jdbc.driverClass}"></property>
     	
     	<property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property>
     	
     	<property name="user" value="${jdbc.user}"></property>
     	
     	<property name="password" value="${jdbc.password}"></property>
     </bean>
      
     <!-- 配置SqlSessionFactory对象 -->
     <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
     
     	<!-- 配置数据源 -->
     	<property name="dataSource" ref="dataSource"></property>    	
     	<!-- 配置mybatis核心配置文件 -->
     	<property name="configLocation" value="classpath:SqlMapConfig.xml"></property>
     	
     	
     		<!-- 配置PageHelper插件 (mybatis分页) -->
        	<property name="plugins">
            	<array>
                	<bean class="com.github.pagehelper.PageInterceptor">
                    	<property name="properties">
                       		 <value>
                			helperDialect=mysql
								reasonable = true
             			 </value>
                    	</property>
                	</bean>
            	</array>
        	</property>
     	
     	
     	
     </bean>
      
     <!-- 配置mapper文件扫描 -->
     <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
		 <property name="basePackage" value="com.yh.mapper"></property>
     </bean>
      
</beans>

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。