From 9bc7963d4c05243f14b224f4952644719cb43d4b Mon Sep 17 00:00:00 2001 From: mcutegs2 Date: Mon, 15 Jun 2020 19:24:05 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"1.=20DB=20=EC=97=B0=EA=B2=B0=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20Dao,=20Vo=20=EC=9E=90=EB=B0=94=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=83=9D=EC=84=B1"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e2e4c47a1542265a69d2352a02496238a5c9da6e. --- hospital/src/main/java/DB/BasicDao.java | 28 ----- hospital/src/main/java/DB/BoardDao.java | 115 ------------------ hospital/src/main/java/DB/BoardVo.java | 69 ----------- hospital/src/main/java/DB/MemberDao.java | 78 ------------ hospital/src/main/java/DB/MemberVo.java | 75 ------------ .../main/java/command/BoardViewCommand.java | 20 --- .../src/main/java/controller/Fcontroller.java | 2 - hospital/src/main/webapp/boardView.jsp | 50 -------- hospital/src/main/webapp/index.jsp | 2 +- hospital/src/main/webapp/patientJoin.jsp | 26 +++- 10 files changed, 25 insertions(+), 440 deletions(-) delete mode 100644 hospital/src/main/java/DB/BasicDao.java delete mode 100644 hospital/src/main/java/DB/BoardDao.java delete mode 100644 hospital/src/main/java/DB/BoardVo.java delete mode 100644 hospital/src/main/java/DB/MemberDao.java delete mode 100644 hospital/src/main/java/DB/MemberVo.java delete mode 100644 hospital/src/main/java/command/BoardViewCommand.java delete mode 100644 hospital/src/main/webapp/boardView.jsp diff --git a/hospital/src/main/java/DB/BasicDao.java b/hospital/src/main/java/DB/BasicDao.java deleted file mode 100644 index f808b23..0000000 --- a/hospital/src/main/java/DB/BasicDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package DB; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -public class BasicDao { - private String driver = "com.mysql.jdbc.Driver"; - private String url = "jdbc:mysql://@110.35.119.108:3307:hospital_DB"; - private String user = "mes"; - private String password = "Mestkdrhdghldmlth1!"; - protected Connection conn; - protected PreparedStatement psmt; - protected ResultSet rs; - - public BasicDao() { - try { - Class.forName(this.driver); - this.conn = DriverManager.getConnection(this.url, this.user, this.password); - - } catch (SQLException | ClassNotFoundException var2) { - var2.printStackTrace(); - } - - } -} diff --git a/hospital/src/main/java/DB/BoardDao.java b/hospital/src/main/java/DB/BoardDao.java deleted file mode 100644 index 3c91978..0000000 --- a/hospital/src/main/java/DB/BoardDao.java +++ /dev/null @@ -1,115 +0,0 @@ -package DB; - -import java.sql.SQLException; -import java.util.ArrayList; - -public class BoardDao extends BasicDao { - private final String SELECT_ALL = "SELECT * FROM user_tbl"; - - public BoardDao() { - } - - public ArrayList select() { - ArrayList list = new ArrayList(); - - try { - this.psmt = this.conn.prepareStatement("SELECT * FROM user_tbl"); - this.rs = this.psmt.executeQuery(); - - while(this.rs.next()) { - BoardVo vo = new BoardVo(); - vo.u_ID(this.rs.getInt("u_ID")); - vo.setWriter(this.rs.getString("writer")); - vo.setwDate(this.rs.getDate("wDate")); - vo.setTitle(this.rs.getString("title")); - vo.setContent(this.rs.getString("content")); - vo.setHit(this.rs.getInt("hit")); - list.add(vo); - } - } catch (SQLException var3) { - var3.printStackTrace(); - } - - return list; - } - - public BoardVo select(BoardVo vo) { - try { - int boardId = vo.getBoardId(); - this.psmt = this.conn.prepareStatement("SELECT * FROM BOARD WHERE boardId = ?"); - this.psmt.setInt(1, boardId); - this.rs = this.psmt.executeQuery(); - if (this.rs.next()) { - vo.setWriter(this.rs.getString("writer")); - vo.setwDate(this.rs.getDate("wDate")); - vo.setTitle(this.rs.getString("title")); - vo.setContent(this.rs.getString("content")); - vo.setHit(this.rs.getInt("hit")); - this.hitCountUp(this.rs.getInt("boardId")); - } - } catch (SQLException var3) { - var3.printStackTrace(); - } - - return vo; - } - - public int insert(BoardVo vo) { - int n = 0; - - try { - this.psmt = this.conn.prepareStatement("insert into board values(b_num.nextval,?,?,?,?,0)"); - this.psmt.setString(1, vo.getWriter()); - this.psmt.setDate(2, vo.getwDate()); - this.psmt.setString(3, vo.getTitle()); - this.psmt.setString(4, vo.getContent()); - n = this.psmt.executeUpdate(); - } catch (SQLException var4) { - var4.printStackTrace(); - } - - return n; - } - - public int update(BoardVo vo) { - int n = 0; - - try { - this.psmt = this.conn.prepareStatement("update board set content = ? where boardId = ?"); - this.psmt.setInt(1, vo.getBoardId()); - this.psmt.setString(2, vo.getContent()); - n = this.psmt.executeUpdate(); - } catch (SQLException var4) { - var4.printStackTrace(); - } - - return n; - } - - public int delete(BoardVo vo) { - int n = 0; - - try { - this.psmt = this.conn.prepareStatement("delete from board where boardId = ?"); - this.psmt.setInt(1, vo.getBoardId()); - n = this.psmt.executeUpdate(); - } catch (SQLException var4) { - var4.printStackTrace(); - } - - return n; - } - - public void hitCountUp(int id) { - String var2 = "UPDATE board set hit = hit+1 where boardId = ?"; - - try { - this.psmt = this.conn.prepareStatement("UPDATE board set hit = hit+1 where boardId = ?"); - this.psmt.setInt(1, id); - this.psmt.executeUpdate(); - } catch (SQLException var4) { - var4.printStackTrace(); - } - - } -} diff --git a/hospital/src/main/java/DB/BoardVo.java b/hospital/src/main/java/DB/BoardVo.java deleted file mode 100644 index aeb3be9..0000000 --- a/hospital/src/main/java/DB/BoardVo.java +++ /dev/null @@ -1,69 +0,0 @@ -package DB; - -import java.sql.Date; - -public class BoardVo { - int boardId; - String writer; - String u_ID; - Date wDate; - String title; - String content; - int hit; - - public BoardVo() { - } - - public String getWriter() { - return this.writer; - } - - public void setWriter(String writer) { - this.writer = writer; - } - - public int getBoardId() { - return this.boardId; - } - - public void setBoardId(int boardId) { - this.boardId = boardId; - } - - public Date getwDate() { - return this.wDate; - } - - public void setwDate(Date wDate) { - this.wDate = wDate; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public int getHit() { - return this.hit; - } - - public void setHit(int hit) { - this.hit = hit; - } - - public void u_ID(String u_ID) { - // TODO Auto-generated method stub - - } -} diff --git a/hospital/src/main/java/DB/MemberDao.java b/hospital/src/main/java/DB/MemberDao.java deleted file mode 100644 index e4c3425..0000000 --- a/hospital/src/main/java/DB/MemberDao.java +++ /dev/null @@ -1,78 +0,0 @@ - -package DB; - -import java.sql.SQLException; -import java.util.ArrayList; - -public class MemberDao extends BasicDao { - private final String MEMBER_LIST = "SELECT * FROM member"; - private final String MEMBER_CHECK = "SELECT * FROM member WHERE id = ? and pw = ?"; - private final String MEMBER_INSERT = "INSERT into member values(?,?,?,?,?,?,?)"; - - public MemberDao() { - } - - public ArrayList select() { - ArrayList list = new ArrayList(); - - try { - this.psmt = this.conn.prepareStatement("SELECT * FROM member"); - this.rs = this.psmt.executeQuery(); - - while(this.rs.next()) { - MemberVo member = new MemberVo(); - member.setId(this.rs.getString("ID")); - member.setName(this.rs.getString("NAME")); - member.setAddr(this.rs.getString("ADDR")); - member.setTel(this.rs.getString("TEL")); - member.setGender(this.rs.getString("GENDER")); - member.setHobby(this.rs.getString("HOBBY")); - list.add(member); - } - } catch (SQLException var3) { - var3.printStackTrace(); - } - - return list; - } - - public MemberVo selectMember(MemberVo member) { - MemberVo vo = null; - - try { - this.psmt = this.conn.prepareStatement("SELECT * FROM member WHERE id = ? and pw = ?"); - this.psmt.setString(1, member.getId()); - this.psmt.setString(2, member.getPw()); - this.rs = this.psmt.executeQuery(); - if (this.rs.next()) { - String id = this.rs.getString("id"); - String pw = this.rs.getString("pw"); - vo = new MemberVo(id, pw); - } - } catch (SQLException var5) { - var5.printStackTrace(); - } - - return vo; - } - - public int memberInsert(MemberVo member) { - int n = 0; - - try { - this.psmt = this.conn.prepareStatement("INSERT into member values(?,?,?,?,?,?,?)"); - this.psmt.setString(1, member.getId()); - this.psmt.setString(2, member.getName()); - this.psmt.setString(3, member.getPw()); - this.psmt.setString(4, member.getAddr()); - this.psmt.setString(5, member.getTel()); - this.psmt.setString(6, member.getGender()); - this.psmt.setString(7, member.getHobby()); - n = this.psmt.executeUpdate(); - } catch (SQLException var4) { - var4.printStackTrace(); - } - - return n; - } -} diff --git a/hospital/src/main/java/DB/MemberVo.java b/hospital/src/main/java/DB/MemberVo.java deleted file mode 100644 index a696c8f..0000000 --- a/hospital/src/main/java/DB/MemberVo.java +++ /dev/null @@ -1,75 +0,0 @@ -package DB; - -public class MemberVo { - public String id; - public String name; - public String pw; - public String addr; - public String tel; - public String gender; - public String hobby; - - public MemberVo() { - } - - public MemberVo(String id, String pw) { - this.id = id; - this.pw = pw; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddr() { - return this.addr; - } - - public void setAddr(String addr) { - this.addr = addr; - } - - public String getTel() { - return this.tel; - } - - public void setTel(String tel) { - this.tel = tel; - } - - public String getGender() { - return this.gender; - } - - public void setGender(String gender) { - this.gender = gender; - } - - public String getHobby() { - return this.hobby; - } - - public void setHobby(String hobby) { - this.hobby = hobby; - } - - public String getId() { - return this.id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPw() { - return this.pw; - } - - public void setPw(String pw) { - this.pw = pw; - } - } \ No newline at end of file diff --git a/hospital/src/main/java/command/BoardViewCommand.java b/hospital/src/main/java/command/BoardViewCommand.java deleted file mode 100644 index 3dd86eb..0000000 --- a/hospital/src/main/java/command/BoardViewCommand.java +++ /dev/null @@ -1,20 +0,0 @@ -package command; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import DB.BoardDao; -import DB.BoardVo; - -public class BoardViewCommand implements Command { - public BoardViewCommand() { - } - - public String exec(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - return "boardView.jsp"; - } -} diff --git a/hospital/src/main/java/controller/Fcontroller.java b/hospital/src/main/java/controller/Fcontroller.java index f225cb4..345f069 100644 --- a/hospital/src/main/java/controller/Fcontroller.java +++ b/hospital/src/main/java/controller/Fcontroller.java @@ -11,7 +11,6 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import command.BoardViewCommand; import command.Command; import command.HomeCommand; import command.UserJoinCommand; @@ -37,7 +36,6 @@ public class Fcontroller extends HttpServlet { list.put("/patientlogin.do", new patientLoginCommand()); // 환자 로그인 처리 list.put ("/UserJoin.do", new UserJoinCommand()); // 임직원 회원가입 페이지 list.put ("/patientJoin.do", new patientJoinCommand()); // 환자 회원가입 페이지 - list.put("/boardView.do", new BoardViewCommand()); // 데이터 보기 test 페이지 //이 부분에 계속적으로 매핑을 추가하면 됨 } diff --git a/hospital/src/main/webapp/boardView.jsp b/hospital/src/main/webapp/boardView.jsp deleted file mode 100644 index 89dd079..0000000 --- a/hospital/src/main/webapp/boardView.jsp +++ /dev/null @@ -1,50 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Insert title here - - - - - -
-
-
- - - - - - - - - - - - - - - -
작성자${board.writer}작성일자${board.wDate}
제목${board.title}
내용${board.content}
-
-
-
- - \ No newline at end of file diff --git a/hospital/src/main/webapp/index.jsp b/hospital/src/main/webapp/index.jsp index ead8ab9..59f6e7b 100644 --- a/hospital/src/main/webapp/index.jsp +++ b/hospital/src/main/webapp/index.jsp @@ -5,7 +5,7 @@ 병원 관리 시스템 - + diff --git a/hospital/src/main/webapp/patientJoin.jsp b/hospital/src/main/webapp/patientJoin.jsp index 385532e..44022d9 100644 --- a/hospital/src/main/webapp/patientJoin.jsp +++ b/hospital/src/main/webapp/patientJoin.jsp @@ -56,7 +56,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -95,6 +95,28 @@ + + + + +
환자성명회원명
회원ID   생년월일
나이병과
성별
직책 +
+     + +
+
+     + +
+
+     + +
+
+     + +
+