[Spring] Mybatis 연동 (2) interface 생성 후 JUnit으로 테스트 1. 패키지 생성 후 interface Mapper 생성 2. TestMapper.java 에 코드 작성 3. JUnit 으로 테스트(src/test/java 밑에) ERROR: org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@42dafa95] to prepare test instance [com.sora.shop.db.Int..
[Spring] Mybatis 연동 (1) root-context.xml 파일에SqlSessionFactory와 SqlSession 설정을 추가해야한다. mybatis에서 SqlSession을 생성하기 위해 SqlSessionFactory를 사용한다. (참고 - http://www.mybatis.org/spring/ko/getting-started.html) mybatis와 spring 연동을 위해 pom.xml에mybatis, mybatis-spring 2개의 라이브러리를 추가한다. 마이바티스는 개발자가 지정한 SQL, 저장프로시저 그리고 몇가지 고급 매핑을 지원하는 퍼시스턴스 프레임워크이다. 마이바티스는 JDBC로 처리하는 상당부분의 코드와 파라미터 설정및 결과 매핑을 대신해준다. 마이바티스는 데이터..
[Spring] Mysql과 JUnit (2) root-context.xml에 Mysql과 관련된 설정을 추가하고 JUnit으로 확인하겠습니다. 1. Java Mysql 기본 연동 코드 public class MysqlConnectionTest { public static void main(String[] args) { Connection con = null;PreparedStatement pstmt = null;ResultSet rs = null;try {Class.forName("com.mysql.cj.jdbc.Driver");con = DriverManager.getConnection("jdbc:mysql://localhost:3306/?useSSL=false&serverTimezone=UTC", ..
[Spring] Mysql과 JUnit pom.xml에 Mysql, JUnit 사용을 위한 라이브러리 추가 후JUint으로 연동 확인 (JDK 1.8과 STS, Tomcat, Mysql 까지 다 설치된 상황입니다.) 1. java와 springframework 버전 수정 1.6 -> 1.83.1.1 -> 5.1.1로 수정합니다.(pom.xml을 열었을 경우 overview 탭에서 수정하거나 소스코드가 보이는 pom.xml 탭에서 수정해도 됩니다.) 2. compiler 버전 수정 build 태그 안에 comiler의 source와 target의 1.6 에서 1.8 로 수정합니다. 저장 후 디렉터리 부분에서 JavaSE-1.6이 1.8로 바뀌는지 확인합니다. 바뀌지 않았다면 프로젝트명 오른쪽 클릭후 Mav..
- Total
- Today
- Yesterday
- 설치
- react
- web.xml이란?
- mybatis-spring
- dataSource
- install
- sqldeveloper
- Get
- Semantic
- cordova
- Oracle
- jUnit
- servlet-context.xml
- Connection-Pool
- root-context.xml
- 디렉터리
- 디스크 없음
- import
- instant
- mybatis
- create-react-app
- clss
- Resources
- mysql
- postman
- Window10
- php
- spring
- vscode
- pom.xml
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |