returnType

resultSet
Setter 쿼리문

 

 

board-mapping.xml

mapper namespace=""

<insert id=""

 

 

sql-map-config.xml

<properties

<typeAliases (객체명)

DataSource 설정

<environments

Sql Mapper 설정

<mapperss

 

 

<dataSource type type="POOLED" // pooled 필요할 때마다 생성해서 보내준다 vs unpooled

 

SqlSession 

SqlSessionFactoryBean.java

private 클래스 안에서만 이용가능

static 메모리 공유

그래서 getSqlSession

객체 하나만 생성해서 돌려주는거 = Singleton Pattern

Reader 객체 - 문자 String을 읽어오는 추상 클래스 [ Resources에서 제공하는 getResourceAsReader를 통해 ("")경로를 읽어온다 ]

읽어온 객체를 sessiionFactory에 담았다

 

그래서 getSqlSessionInstance()를 통해 SqlSession을 반환다.

 

 

BoardDAO

SqlSession 객체로 만든 mybatis객체 만든다

클래스명으로 접근 가능한 이유 : static이라

insertBoard(BoardVO vo){

mybatis.insert("BoardDAO.insertBoard", vo);

mybatis.commit(); // 현재 자동 commit 

 

 

 

 

 

 

 

+ Recent posts