标签:ges snap 9.png mysql ssi log maven display map
1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 2 <modelVersion>4.0.0</modelVersion> 3 <groupId>cn.xiangxu.spring</groupId> 4 <artifactId>mybatis03</artifactId> 5 <version>0.0.1-SNAPSHOT</version> 6 <dependencies> 7 <dependency> 8 <groupId>org.springframework</groupId> 9 <artifactId>spring-webmvc</artifactId> 10 <version>3.2.8.RELEASE</version> 11 </dependency> 12 <dependency> 13 <groupId>org.mybatis</groupId> 14 <artifactId>mybatis</artifactId> 15 <version>3.2.8</version> 16 </dependency> 17 <dependency> 18 <groupId>org.mybatis</groupId> 19 <artifactId>mybatis-spring</artifactId> 20 <version>1.2.3</version> 21 </dependency> 22 <dependency> 23 <groupId>org.springframework</groupId> 24 <artifactId>spring-jdbc</artifactId> 25 <version>3.2.8.RELEASE</version> 26 </dependency> 27 <dependency> 28 <groupId>mysql</groupId> 29 <artifactId>mysql-connector-java</artifactId> 30 <version>5.1.23</version> 31 </dependency> 32 <dependency> 33 <groupId>junit</groupId> 34 <artifactId>junit</artifactId> 35 <version>4.12</version> 36 </dependency> 37 </dependencies> 38 </project>
只需要添加spring的配置文件,不需要添加mybatis的配置文件;直接将mybatis有关的配置在spring配置文件中完成
2.1 配置能读取含有数据库连接信息的properties文件
2.2 配置数据库连接池
2.3 配置SqlSessionFactoryBean
SqlSessionFactoryBean中包含了数据库连接池和映射文件的信息
2.4 配置MapperScannerConfigurer
标签:ges snap 9.png mysql ssi log maven display map
原文地址:http://www.cnblogs.com/NeverCtrl-C/p/6875878.html