본문 바로가기

Programming/Java_Etc

Java Mybatis설정에서 MS-SQL연결 설정방법

반응형
<?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>
    <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"/>
            <dataSource type="POOLED">
                <property name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
                <property name="url" value="jdbc:sqlserver://<주소>:<포트>;databaseName=<DB이름>;encrypt=true;trustServerCertificate=true;"/>
                <property name="username" value="이름"/>
                <property name="password" value="비밀번호"/>
            </dataSource>
        </environment>
    </environments>
    <mappers>
        <mapper resource="mapper/dbMapper.xml"/>
        <mapper resource="mapper/itemMapper.xml"/>
    </mappers>
</configuration>

 

encrypt=true;trustServerCertificate=true;

이 구문을 넣어줘야한다.

반응형