예외처리
-
SqlSessionFactory 클래스 정리JAVA/ORM 2024. 7. 29. 19:22
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 MyBatis를 배우는데 자연스럽게 사용하지만 궁금한 인터페이스가 있었다.SqlSessionFactory는 MyBatis 프레임워크에서 중요한 인터페이스 중 하나이다.이 인터페이스는 데이터베이스와의 연결을 설정하고 SQL 세션을 생성하는 역할을 한다.이름에서 알 수 있는 점은, Factory 패턴이 사용되었다는 점이다. ✔ SqlSessionFactory 인터페이스 정의SqlSessionFactory는 MyBatis에서 DB와의 연결을 설정하고 SQL 세션을 생성하는 인터페이스이다.MyBatis는 데이터베이스 접근 계층을 제공한다.개발자는 SQL 매퍼 파일을 통해 SQL 쿼리와 자바 객체 간의 매핑을 할 수 있다. ⌨..