Oracle, Mssql, Maven Mybaits JDBC 설정
첨부파일
sqljdbc_6.0.7728.100_kor.exe - MSSQL JDBC 6.0. 통합본
sqljdbc42.jar - Maven 설치 대상 jar
1. Oracle
Maven Dependency 설정 (pom.xml)
<repositories>
<repository>
<id>oracle</id>
<name>ORACLE JDBC Repository</name>
<url>http://maven.jahia.org/maven2</url>
</repository>
</repositories>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0</version>
</dependency>
mybatis-config.xml
<environments default="oracle"> <environment id="oracle"> <transactionManager type="JDBC" /> <dataSource type="POOLED"> <property name="driver" value="oracle.jdbc.driver.OracleDriver" /> <property name="url" value="jdbc:oracle:localhost:1521:orcl" /> <property name="username" value="userid" /> <property name="password" value="password" /> </dataSource> </environment> </environments>
2. MSSQL
jar maven local install
mvn install:install-file -Dfile=H:\etc\mssql_2014_express\jdbc\sqljdbc_6.0\kor\sqljdbc42.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc42 -Dversion=4.2
Maven Dependency 설정 (pom.xml)
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc42</artifactId>
<version>4.2</version>
</dependency>
mybatis-config.xml
<environments default="mssql"> <environment id="mssql"> <transactionManager type="JDBC" /> <dataSource type="POOLED"> <property name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> <property name="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=targetdb;" /> <property name="username" value="userid" /> <property name="password" value="password" /> </dataSource> </environment> </environments>
해당 게시물이 있는 블로그
http://blog.naver.com/wizardkyn/220844425127