Notice
Recent Posts
Recent Comments
Link
«   2024/10   »
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
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

EmployeeDaoImpl 본문

JSP/SEARCH

EmployeeDaoImpl

GAWON 2023. 6. 12. 17:05
package org.joonzis.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;

import org.joonzis.mybatis.config.DBService;
import org.joonzis.vo.EmployeeVO;




public class EmployeeDaoImpl implements EmployeeDao {
	
	//DAO 객체 생성
	private static EmployeeDaoImpl instace = null;
	public EmployeeDaoImpl() {}
	public static EmployeeDaoImpl GetInstance() {
		if(instace == null) {
			instace = new EmployeeDaoImpl();
		}
		return instace;
	}
	//필드
	private static SqlSession sqlSession = null;
	private synchronized static SqlSession getSqlSession() {
		if(sqlSession == null)
			sqlSession = DBService.getFactory().openSession(false);
		return sqlSession;
	}
	 
	@Override
	public List<EmployeeVO> getALLEmployees() {
		return getSqlSession().selectList("select_all");
	}
	
	@Override
	public List<EmployeeVO> search_dept(int department_id ) {
		return getSqlSession().selectList("search_dept",department_id);
	}

	@Override
	public List<EmployeeVO> getList(Map<String, String> map) {
		return getSqlSession().selectList("getList",map);
	}
		
}

'JSP > SEARCH' 카테고리의 다른 글

employees  (0) 2023.06.12
sqlmap  (0) 2023.06.12
DBService  (0) 2023.06.12
EmployeeDao  (0) 2023.06.12
Controller  (0) 2023.06.12