关于mybatis的定义,官方的正式定义:java的持久层框架,支持存储过程和sql,使用xml或注解的方式定义。
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 |
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:jdbc.properties</value> </list> </property> </bean> <bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close"> <property name="driverClass"
value="${jdbc.driverClassName}"
/> <property name="jdbcUrl"
value="${jdbc.url}"
/> <property name="user"
value="${jdbc.username}"
/> <property name="password"
value="${jdbc.password}"
/> <property name="checkoutTimeout"
value="30000"
/> <property name="maxPoolSize"
value="15"
/> <property name="idleConnectionTestPeriod"
value="180"
/> <property name="maxIdleTime"
value="180"
/> </bean> <bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource"
ref="dataSource"
/> <!--configLocation属性指定mybatis的核心配置文件--> <property name="configLocation"
value="classpath:mybatisConfiguration.xml"
/> <!-- 所有配置的mapper文件 --> <property name="mapperLocations"
value="classpath*:com/mapper/*.xml"
/> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage"
value="com.pro.dao"
/> </bean> |
原文:http://www.cnblogs.com/leeying/p/3577301.html