본문 바로가기

WebStudy/MVC2기반 Shopping mall

Step 4 - innterface DAOinter 만들기

db 작업을 처리하는 MemberDAO class 를 만들기 전에 DAO interface를 만들어서

무엇을 만들어야하는지 가이드라인을 잡아보자.

 

interface name : DAOInter

package : net.member.db

 


import java.sql.SQLException;
import java.util.ArrayList;

public interface DAOInter {
 
 public boolean insertMember(MemberDTO dto) throws SQLException;
 public int userCheck(String id, String pw) throws SQLException;
 public int confirmId(String id) throws SQLException;
 public MemberDTO getMember(String id) throws SQLException;
 public void updateMember(MemberDTO dto) throws SQLException;
 public int deleteMember(String id, String pw) throws SQLException;
 public MemberDTO  findId(String name, String email, String phone) throws SQLException;
 public boolean isAdmin(String id) throws Exception;
 public ArrayList<MemberDTO> sampleTest() throws Exception;
}

 

굳이 interface 를 만들어서 꼭 구현해야 할 필요는 없지만 무엇을 만들어야하는지 미리 가이드를 잡아보는 느낌적인 느낌으로...