반응형
sqlsessionfactory
-
[Spring] Mybatis SqlSessionFactory 란Spring/spring framework 기본 및 이론 2020. 6. 1. 15:14
SqlSessionFactory SqlSessionFactory는 데이터베이스와의 연결과 SQL의 실행에 대한 모든 것을 가진 가장 중요한 객체다. 이 객체가 DataSource를 참조하여 MyBatis와 Mysql 서버를 연동시켜준다. SqlSessionFactory를 생성해주는 SqlSessionFactoryBean 객체를 먼저 설정하여야 한다. root-context.xml cofing MyBatis는 SQL Mapping 프레임워크로 별도의 설정 파일을 가질 수 있다. src/main/resources에 mybatis-config.xml 파일을 추가 Mybatis에 별도의 설정을 주고 싶으면 위의 파일을 이용 root-context.xml의 sqlSessionFactory에 다음과 같이 confi..