Pom配置:
1 <dependency> 2 <groupId>com.microsoft.sqlserver</groupId> 3 <artifactId>sqljdbc4</artifactId> 4 <version>4.0</version> 5 </dependency>
mybatis配置
1 <?xml version="1.0" encoding="UTF-8" ?> 2 3 <!DOCTYPE configuration PUBLIC 4 "-//mybatis.org//DTD Config 3.0//EN" 5 "http://mybatis.org/dtd/mybatis-3-config.dtd"> 6 7 <configuration> 8 <typeAliases> 9 <typeAlias alias="xxx" type="com.myproject.demo.model.xxx" /> 10 </typeAliases> 11 12 <environments default="development"> 13 <environment id="development"> 14 <transactionManager type="JDBC" /> 15 <dataSource type="POOLED"> 16 <property name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> 17 <property name="url" value="jdbc:sqlserver://***.*.*.*:1433;databaseName=Northwind; catalogName=Northwind" /> 18 <property name="username" value="sa" /> 19 <property name="password" value="********" /> 20 <property name="poolMaximumActiveConnections" value="50" /> 21 </dataSource> 22 </environment> 23 </environments> 24 25 <mappers> 26 <mapper resource="maps/sqlmap.xml" /> 27 </mappers> 28 </configuration>
记录下自己以后学习用