diff --git a/VamPa/pom.xml b/VamPa/pom.xml index 9f57708..4793dc8 100644 --- a/VamPa/pom.xml +++ b/VamPa/pom.xml @@ -131,6 +131,32 @@ HikariCP 3.4.2 + + + + + org.mybatis + mybatis + 3.5.3 + + + + org.mybatis + mybatis-spring + 2.0.3 + + + + org.springframework + spring-tx + ${org.springframework-version} + + + + org.springframework + spring-jdbc + ${org.springframework-version} + diff --git a/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml b/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml index 6880b3b..f222aa9 100644 --- a/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/VamPa/src/main/webapp/WEB-INF/spring/root-context.xml @@ -15,6 +15,10 @@ + + + + diff --git a/VamPa/src/test/java/com/vam/sample/DataSourceTests.java b/VamPa/src/test/java/com/vam/sample/DataSourceTests.java index 2420987..4bb513f 100644 --- a/VamPa/src/test/java/com/vam/sample/DataSourceTests.java +++ b/VamPa/src/test/java/com/vam/sample/DataSourceTests.java @@ -4,6 +4,8 @@ import java.sql.Connection; import javax.sql.DataSource; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -17,13 +19,18 @@ public class DataSourceTests { @Autowired private DataSource dataSource; + @Autowired + private SqlSessionFactory sqlSessionFactory; + @Test public void testConnection() { try( - Connection con = dataSource.getConnection(); + Connection con = dataSource.getConnection(); + SqlSession session = sqlSessionFactory.openSession(); ){ - System.out.println("con="+con); + System.out.println("con=" + con); + System.out.println("session=" + session); }catch(Exception e) { e.printStackTrace(); diff --git a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties index 25f0d93..e9210cf 100644 --- a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties +++ b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Sat Aug 08 00:16:06 KST 2020 +#Sat Aug 08 00:23:00 KST 2020 version=1.0.0-BUILD-SNAPSHOT groupId=com.vam m2e.projectName=VamPa diff --git a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml index 9f57708..4793dc8 100644 --- a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml +++ b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml @@ -131,6 +131,32 @@ HikariCP 3.4.2 + + + + + org.mybatis + mybatis + 3.5.3 + + + + org.mybatis + mybatis-spring + 2.0.3 + + + + org.springframework + spring-tx + ${org.springframework-version} + + + + org.springframework + spring-jdbc + ${org.springframework-version} + diff --git a/VamPa_MySQL/pom.xml b/VamPa_MySQL/pom.xml index fca2307..2bf232f 100644 --- a/VamPa_MySQL/pom.xml +++ b/VamPa_MySQL/pom.xml @@ -125,6 +125,32 @@ 3.4.2 + + + + org.mybatis + mybatis + 3.5.3 + + + + org.mybatis + mybatis-spring + 2.0.3 + + + + org.springframework + spring-tx + ${org.springframework-version} + + + + org.springframework + spring-jdbc + ${org.springframework-version} + + javax.inject diff --git a/VamPa_MySQL/src/main/webapp/WEB-INF/spring/root-context.xml b/VamPa_MySQL/src/main/webapp/WEB-INF/spring/root-context.xml index 014e586..f7146bf 100644 --- a/VamPa_MySQL/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/VamPa_MySQL/src/main/webapp/WEB-INF/spring/root-context.xml @@ -15,6 +15,10 @@ + + + + diff --git a/VamPa_MySQL/src/test/java/com/vam/persistence/DataSourceTests.java b/VamPa_MySQL/src/test/java/com/vam/persistence/DataSourceTests.java index 62eaaa5..aee83ff 100644 --- a/VamPa_MySQL/src/test/java/com/vam/persistence/DataSourceTests.java +++ b/VamPa_MySQL/src/test/java/com/vam/persistence/DataSourceTests.java @@ -4,6 +4,8 @@ import java.sql.Connection; import javax.sql.DataSource; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -17,13 +19,18 @@ public class DataSourceTests { @Autowired private DataSource dataSource; + @Autowired + private SqlSessionFactory sqlSessionFactory; + @Test public void testConnection() { try( - Connection con = dataSource.getConnection(); + Connection con = dataSource.getConnection(); + SqlSession session = sqlSessionFactory.openSession(); ){ - System.out.println("con="+con); + System.out.println("con=" + con); + System.out.println("session=" + session); }catch(Exception e) { e.printStackTrace(); diff --git a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties index ff3492c..892e9f2 100644 --- a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties +++ b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Sat Aug 08 00:16:25 KST 2020 +#Sat Aug 08 00:23:18 KST 2020 version=1.0.0-BUILD-SNAPSHOT groupId=com.vam m2e.projectName=VamPa_MySQL diff --git a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml index fca2307..2bf232f 100644 --- a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml +++ b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.xml @@ -125,6 +125,32 @@ 3.4.2 + + + + org.mybatis + mybatis + 3.5.3 + + + + org.mybatis + mybatis-spring + 2.0.3 + + + + org.springframework + spring-tx + ${org.springframework-version} + + + + org.springframework + spring-jdbc + ${org.springframework-version} + + javax.inject