Open berryberrybin opened 2 years ago
public class Member {
private String id;
private String pwd;
private String name;
private int age;
private String phone;
private String addr;
private String joinDate;
public Member() {}
public Member(String id, String pwd, String name, int age, String phone, String addr, String joinDate) {
super();
this.id = id;
this.pwd = pwd;
this.name = name;
this.age = age;
this.phone = phone;
this.addr = addr;
this.joinDate = joinDate;
}
// 각 Getter Setter 작성
}
public interface MemberDAO {
/**
* 전체검색
* : SELECT * FROM MEMBER ORDER BY JOIN_DATE DESC
* */
List<Member> selectAll();
/**
* 조건검색(검색필드와 검색단어를 전달받아 검색필드에 검색단어를포함한 레코드를 검색하기 )
* SELECT * FROM MEMBER WHERE ID LIKIE ?
SELECT * FROM MEMBER WHERE NAME LIKIE ?
SELECT * FROM MEMBER WHERE ADDR LIKIE ?
* */
List<Member> searchByKeyWord(String keyField, String keyWord);
/**
* 등록하기
* insert into member(id,pwd,name,age,phone,addr, join_date)
values(?,?,?,?,?,?, sysdate)
* */
int insert(Member member);
/**
* ID중복여부 체크
* @return: true이면 중복이다, false이면 중복아니다
* SELECT ID FROM MEMBER WHERE ID=?
* */
boolean duplicateById(String id);
/**
* 회원 삭제하기
* DELETE FROM MEMBER WHERE ID=?
* */
int delete(String id);
/**
* 회원상세정보 검색하기 (ID에 해당하는 회원의 모든 정보 검색하기)
* SELECT * FROM MEMBER WHERE ID=?
* */
Member selectById(String id);
}
public class MemberDAOImpl implements MemberDAO {
@Override
public List<Member> selectAll() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Member> searchByKeyWord(String keyField, String keyWord) {
// TODO Auto-generated method stub
return null;
}
@Override
public int insert(Member member) {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean duplicateById(String id) {
// TODO Auto-generated method stub
return false;
}
@Override
public int delete(String id) {
// TODO Auto-generated method stub
return 0;
}
@Override
public Member selectById(String id) {
// TODO Auto-generated method stub
return null;
}
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
테이블 생성 및 레코드 추가
Oracle SQL Developer - scott계정에 SQL 쿼리문 추가