mybatis连接SQLServer



1、首先下载安装sqlserver 2008(这里略过)


2、打开Sql Server Configuration Manager,启用TCP/IP,并重启SQLServe




3、在http://www.microsoft.com/zh-CN/download/details.aspx?id=11774 下载SQLServer 的jdbc驱动,并放入项目lib目录下


4、修改jdbc.properties:

jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver

jdbc.url=jdbc\:sqlserver\://127.0.0.1\:1433;DatabaseName=DatabaseName

jdbc.user=xxx

jdbc.password=xxx

5、修改mybatis-config.xml

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>

<properties>  

<propertyname="dialect"value="sqlserver"/>  

</properties>

</configuration>





你可能感兴趣的:(mybatis连接SQLServer)