[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] root-context.xml와 servlet-context.xml Mysql 연동 전에 먼저 알아야할 것이 root-context.xml 입니다. context 관련 xml은 root-context와 servlet-context가 있습니다. root-context.xml 이란? JSP와 관련없는 객체(bean)을 설정합니다.(service, repository) 비지니스 로직을 위한 설정을 합니다. 외부 jar 파일등으로 사용하는 클래스는 태그를 이용하여 작성합니다. 공통 빈을 설정합니다. 저는 view와 밀접하지 않은 정보를 기술하는 xml이라고 이해하고 있습니다. 그렇다면 Mysql관련 설정은 view(jsp)와 관련이 있을까요?이 말을 바꿔보면 Mysql에 jsp가 직접적으로 접근..
- Total
- Today
- Yesterday
- create-react-app
- mybatis
- 디스크 없음
- Get
- cordova
- instant
- pom.xml
- mybatis-spring
- Oracle
- spring
- jUnit
- php
- web.xml이란?
- Semantic
- postman
- Connection-Pool
- install
- Window10
- servlet-context.xml
- react
- sqldeveloper
- import
- 디렉터리
- mysql
- Resources
- vscode
- root-context.xml
- 설치
- clss
- dataSource
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |