Skip to content

๐Ÿคน์ž๋ฐ” JDBC์™€ ์˜ค๋ผํด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ๋ฏธ๋‹ˆ ํ”„๋กœ์ ํŠธ

Notifications You must be signed in to change notification settings

KB-MiniProject-OneEdu/KB-OneEdu-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 

Repository files navigation

KB-OneEdu-Project

0. ๊ตฌ์„ฑ์›

์ตœ์†กํฌ

๊น€๊ฐ€๋นˆ

๋งน์˜์šฑ



1. ํ”„๋กœ์ ํŠธ ์ฃผ์ œ

Java 8 ์„ ์ด์šฉํ•ด ์˜จ๋ผ์ธ ๊ต์œก ํ”Œ๋žซํผ์„ ์ฃผ์ œ๋กœ ์„ ์ •, ์ดํด๋ฆฝ์Šค๋ฅผ ํ™œ์šฉํ•˜์—ฌ JDBC์—ฐ๊ฒฐ, Oracle 8 ๋ฒ„์ „ SQL ์ฟผ๋ฆฌ ๋กœ์ง ์ž‘์„ฑ์„ ์™„๋ฃŒํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋ฉ”์„œ๋“œ ์˜ค๋ฒ„๋กœ๋”ฉ, ์ƒ์„ฑ์ž ์˜ค๋ฒ„๋ผ์ด๋”ฉ, ์˜ˆ์™ธ์ฒ˜๋ฆฌ, ์ปค๋„ฅ์…˜ ํ™œ์šฉ์„ ํ†ตํ•˜์—ฌ ์ž๋ฐ” ๋ฐฑ์—”๋“œ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

2. ํ”„๋กœ์ ํŠธ ๋ชฉ์  ๋ฐ ๋ฐฐ๊ฒฝ

๋น„๋Œ€๋ฉด ์„œ๋น„์Šค ์‹œ๋Œ€์— ๋งž์ถฐ์„œ ์˜จ๋ผ์ธ ๊ต์œก ํ”Œ๋žซํผ ์ œ์ž‘์„ ์ƒ๊ฐํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ง€๊ธˆ๊นŒ์ง€์˜ ๊ฐ•์˜๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์„œ๋น„์Šค ํด๋ž˜์Šค๋ฅผ ํ™•์žฅํ•œ DAO ๊ตฌํ˜„๊ณผ DB ํ…Œ์ด๋ธ” ์„ค๊ณ„ ๊ณผ์ •์„ ํ”„๋กœ์ ํŠธ๋กœ ๊ตฌํ˜„ํ•ด๋ณด๊ณ ์ž ์ œ์ž‘ํ•ด๋ณด๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

3. Use case Diagram

  • ๋ณ€๊ฒฝ ์ „

    ์œ ์Šค์ผ€์ด์Šค ๋‹ค์ด์–ด๊ทธ๋žจ drawio (1)

    • ์•กํ„ฐ ๊ธฐ์ค€ ์œ ์Šค์ผ€์ด์Šค ๋‹ค์ด์–ด๊ทธ๋žจ ์ž‘์„ฑ โ†’ ๊ธฐ๋Šฅ์„ ์ง๊ด€์ ์œผ๋กœ ํ™•์ธํ•˜๊ธฐ ์–ด๋ ต๋‹ค๋Š” ์  + ํด๋ž˜์Šค ์œ„์ฃผ ํ™•์ธ์ด ์–ด๋ ต๋‹ค๋Š” ์  โ‡’ ์ƒˆ๋กญ๊ฒŒ ์žฌ์ž‘์„ฑ
  • ๋ณ€๊ฒฝ ํ›„

์œ ์Šค์ผ€์ด์Šค๋‹ค์ด์–ด๊ทธ๋žจ drawio (1)

ํด๋ž˜์Šค ๊ธฐ๋Šฅ๋ณ„๋กœ ๋‹ค์ด์–ด๊ทธ๋žจ ์žฌ์ž‘์„ฑ  + ๊ธฐ์กด CRUD ๊ธฐ๋Šฅ๊ณผ ์ถ”๊ฐ€ ๊ธฐ๋Šฅ์„ ๋ถ„๋ฆฌ

4. DB Modeling

  • ๋ณ€๊ฒฝ ์ „

    Untitled (5)

  • ๋ณ€๊ฒฝ ํ›„

    Untitled (6)

  • ์ดˆ๊ธฐ DB ๋ชจ๋ธ๋ง ๋•Œ๋Š” ์‹ค์ œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ํ—ˆ์šฉ๋˜๋Š” ์ปฌ๋Ÿผ ๋ช…์„ ๊ณ ๋ คํ•˜์ง€ ๋ชปํ•จ. like ์—ฐ์‚ฐ์ž๋‚˜ check๋ฅผ ์ธ์‹ X

  • ์œ ๋‹ˆํฌํ•œ ์ปฌ๋Ÿผ์„ ์ œ์™ธํ•œ ๋‚˜๋จธ์ง€๋“ค์€ ์ง๊ด€์„ฑ์„ ์œ„ํ•ด ์ปฌ๋Ÿผ๋ช…์„ ์ˆ˜์ •ํ•˜์˜€๊ณ  ๋ฐ์ดํ„ฐ ํƒ€์ž…์˜ ์‚ฌ์ด์ฆˆ๋ฅผ ์•Œ๋งž๊ฒŒ ์ง€์ •ํ•ด์ฃผ์—ˆ๋‹ค.

5. Class Diagram

ํ•™์ƒ๊ณผ ์„ ์ƒ๋‹˜์˜ ํ…Œ์ด๋ธ”์€ ๊ตฌ๋ถ„ํ•˜์˜€์œผ๋‚˜ ์ƒ์† ๊ด€๊ณ„๋ฅผ ํ†ตํ•ด์„œ ์žฌ์‚ฌ์šฉ์„ฑ์„ ๋†’์ด๊ธฐ ์œ„ํ•ด ์œ„์™€ ๊ฐ™์ด ํด๋ž˜์Šค ๊ด€๊ณ„๋ฅผ ์„ค์ •ํ–ˆ๋‹ค.

6. Frount UI (Figma)

https://www.figma.com/embed?embed_host=notion&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FLOzgELsA3rPjTO39zFILla%2FUntitled%3Ftype%3Ddesign%26node-id%3D0%253A1%26mode%3Ddesign%26t%3DjpOVf217dqdEVwdD-1

  • ์ƒ์„ธ ํ™”๋ฉด

    1) ๊ฐ•์˜์ž ์ฐฝ

    ๊ฐ•์˜์ž๊ฐ€ ๋ณธ์ธ์˜ ๊ฐ•์˜ ID์™€ ๊ฐ•์˜๋ช…, ๊ณผ๋ชฉ, ๊ฐ€๊ฒฉ์„ ์ž‘์„ฑํ•ด ๋“ฑ๋ก ๋ฐ ๋ณ€๊ฒฝํ•˜๋Š” ํ™”๋ฉด

    ๋ณธ์ธ์ด ๋‹ด๋‹นํ•˜๊ณ  ์žˆ๋Š” ๊ณผ๋ชฉ ์กฐํšŒ

    2) ํ•™์ƒ์ฐฝ - ์ˆ˜๊ฐ•์ค‘์ธ ๊ฐ•์˜ ๋ชฉ๋ก

    ์ˆ˜๊ฐ•์ƒ์ด ์ˆ˜๊ฐ• ์ค‘์ธ ๊ฐ•์˜ ๋ชฉ๋ก, ๊ฐ•์˜์ˆ˜๊ฐ•, ์ฒ ํšŒํ•˜๋Š” ํ™”๋ฉด

    ์„ ์ƒ๋‹˜ ์ด๋ฆ„, ๊ฐ•์˜๋ช…, ์ข‹์•„์š” ์ˆ˜ ํ‘œ์‹œ

์ƒ์„ธ ๊ธฐ๋Šฅ

CRUD

  • ๊ฐ•์˜์ž๊ฐ€ ๋ณธ์ธ์˜ ๊ฐ•์˜ ID์™€ ๊ฐ•์˜๋ช…, ๊ณผ๋ชฉ, ๊ฐ€๊ฒฉ์„ ์ž‘์„ฑํ•ด ๋“ฑ๋ก ๋ฐ ๋ณ€๊ฒฝ
  • ๋ณธ์ธ์ด ๋‹ด๋‹นํ•˜๊ณ  ์žˆ๋Š” ๊ณผ๋ชฉ ์กฐํšŒ
  • ํ•™์ƒ์ด ์ˆ˜๊ฐ• ์ค‘์ธ ๊ณผ๋ชฉ ์ •๋ณด ์กฐํšŒ
  • ๊ณผ๋ชฉ๋ณ„ ์„ ์ƒ๋‹˜ ์ „์ฒด ๋ชฉ๋ก ์กฐํšŒ
  • ์„ ์ƒ๋‹˜ id๋กœ ๊ฐ•์˜ ๋ชฉ๋ก ์กฐํšŒ
  • ์ธ๊ธฐ ๊ฐ•์˜ ๋ชฉ๋ก ์กฐํšŒ
  • ์ˆ˜๊ฐ•์ž ๊ฐ•์˜ ๋ชฉ๋ก์—์„œ ๊ฐ•์˜ ์‚ญ์ œ
  • ์„ ์ƒ๋‹˜ ๋“ฑ๋ก, ์กฐํšŒ, ๋ณ€๊ฒฝ

์ถ”๊ฐ€ ๊ธฐ๋Šฅ

  • ์ˆ˜๊ฐ•์ž์˜ ํŠน์ • ๊ฐ•์˜ ์ข‹์•„์š” ๊ฐ€๋Šฅ ์—ฌ๋ถ€ ํ™•์ธ
  • ํŠน์ • ์„ ์ƒ๋‹˜ ๊ฐ•์˜์˜ ์ˆ˜๊ฐ•์ž 3๊ฐœ ์ด์ƒ ์ˆ˜๊ฐ• ์ค‘์ด๋ฉด ๊ฐ•์˜ ํ• ์ธ
  • ๊ฐ•์˜ id๋กœ ์ข‹์•„์š” ํ‘œ์‹œ

7. Eclipse Project Structure

  • ๊ตฌ์กฐ

    • com.edu.vo

      • User
      • Student
      • Teacher
    • com.edu.exception

      • IdNotFoundException
      • DuplicateException
    • com.edu.dao

      • EduDAO
      • com.edu.dao.impl
        • EduDAOImpl
    • com.edu.test

      • EduTest
    • config

      • ServcerInfo(interface)
  • ์‹œํ€€์Šค ์ฟผ๋ฆฌ๋ฌธ

8. Business Logic Template - Interface

package com.edu.dao;

import java.util.ArrayList;

import com.edu.vo.User;

public interface EduDAO {

	//๊ณตํ†ต ์ปค๋„ฅ์…˜ ์—ฐ๊ฒฐ๋ถ€
	public Connection getConnection() throws SQLException;
	
	// ์กด์žฌ์—ฌ๋ถ€ ํ™•์ธ
	public int studentIdExist(int id, Connection conn);
	public int teacherIdExist(int id, Connection conn);
	public int lectureIdExist(int id);

	//close ๋ฉ”์„œ๋“œ
	public void closeAll(ResultSet rs, PreparedStatement ps, Connection conn) throws Exception;
	public void closeAll(PreparedStatement ps, Connection conn) throws Exception;

	//**๊ณตํ†ต ๊ธฐ๋Šฅ** (๊ฐ€๋นˆ)
	public ArrayList<User> FindAllTeacher();  //์„ ์ƒ๋‹˜ ์ „์ฒด ๋ชฉ๋ก ์กฐํšŒ
	public ArrayList<User> FindTeacherBySubject(String subject); //๊ณผ๋ชฉ๋ณ„ ์„ ์ƒ๋‹˜ ์ „์ฒด ๋ชฉ๋ก ์กฐํšŒ
	public ArrayList<Lecture> FindLectureByTeacher(int teacherId); //์„ ์ƒ๋‹˜ id๋กœ ๊ฐ•์˜ ๋ชฉ๋ก ์กฐํšŒ
	public Lecture FindLectureById(int lectureId); // ๊ฐ•์˜๋ช… id๋กœ ๊ฐ•์˜ ์กฐํšŒ
	public ArrayList<Lecture> FindBestLectures(); // ์ธ๊ธฐ ๊ฐ•์˜ ๋ชฉ๋ก ์กฐํšŒ
	//๊ณตํ†ต ๊ธฐ๋Šฅ ์ „๋ถ€ : throw IdNotFoundException -> IdExist ๋ฉ”์„œ๋“œ ํ˜ธ์ถœ ํ›„ ์กด์žฌํ•˜์ง€ ์•Š์œผ๋ฉด ์˜ˆ์™ธ 

	//**๊ด€๋ฆฌ์ž** (์˜์šฑ)
	public void addTeacher(Teacher teacher); 
	// ์„ ์ƒ๋‹˜ ๋“ฑ๋ก -> ์ด๋ฉ”์ผ์ด ๋™์ผํ•˜๋ฉด throw AlreadyExistException 
	
	public void updateTeacher(Teacher teacher); // ์„ ์ƒ๋‹˜ ๋ณ€๊ฒฝ
	public void deleteTeacher(int teacherId); // ์„ ์ƒ๋‹˜ ์‚ญ์ œ
	//์œ„ ๋‘๊ฐœ ๋ฉ”์„œ๋“œ ์ „๋ถ€ : throw IdNotFoundException -> IdExist ๋ฉ”์„œ๋“œ ํ˜ธ์ถœ ํ›„ ์กด์žฌํ•˜์ง€ ์•Š์œผ๋ฉด ์˜ˆ์™ธ 

	//**๊ฐ•์˜์ž** (์†กํฌ)
	public void addLecture(Lecture lecture); 
	
	public void updateLecture(Lecture lecture);
	//throw IdNotFoundException

	//**์ˆ˜๊ฐ•์ž**
	
	//(์†กํฌ)
	public ArrayList<Lecture> getAllMyLecture(int studentId); // id๋กœ ์ˆ˜๊ฐ•์ž ๊ฐ•์˜ ๋ชฉ๋ก์กฐํšŒ
	// throw IdNotFoundException

	public void applyLecture(int studentId, Lecture lecture); 
	//์ˆ˜๊ฐ•์ž ๊ฐ•์˜ ๋ชฉ๋ก์— ๊ฐ•์˜ ์ถ”๊ฐ€ -> getAllMyLecture ๋ฉ”์„œ๋“œ ํ˜ธ์ถœํ•ด์„œ ๊ฐ•์˜ ๋ชฉ๋ก ์ถœ๋ ฅ
	// throw AlreadyExistException 

	public void cancleLecture(int studentId, Lecture lecture); // ์ˆ˜๊ฐ•์ž ๊ฐ•์˜ ๋ชฉ๋ก์—์„œ ๊ฐ•์˜ ์‚ญ์ œ
	// throw IdNotFoundException

	//(์˜์šฑ)
	public boolean likePossible(int studentId, int lectureId); // ์ˆ˜๊ฐ•์ž๊ฐ€ ๊ฐ•์˜ ์ข‹์•„์š” ๊ฐ€๋Šฅ ์—ฌ๋ถ€ ํ™•์ธ
	// throw IdNotFoundException( ์ˆ˜๊ฐ•์ž id๋ž‘ ๊ฐ•์˜ id ๋‘˜๋‹ค ํ™•์ธ)

	public void likeLecture(int lectureId); // ๊ฐ•์˜ id๋กœ ์ข‹์•„์š” ํ‘œ์‹œ
	// likePossible ํ˜ธ์ถœํ•ด์„œ true ์ด๋ฉด likeLecture ํ˜ธ์ถœ
	// likePossible ํ˜ธ์ถœํ•ด์„œ false์ด๋ฉด ๋ฉ”์„œ๋“œ ๋‚˜๊ฐ€๊ธฐ	  

	public boolean discountPossible(int studentId, int teacherId); 
	// ์„ ์ƒ๋‹˜ ๊ฐ•์˜๋ฅผ ์ˆ˜๊ฐ•์ž๊ฐ€ 3๊ฐœ ์ด์ƒ ์ˆ˜๊ฐ• ์ค‘์ด๋ฉด ๊ฐ•์˜ ํ• ์ธ
	// throw IdNotFoundException
	
}

9. DB ํ…Œ์ด๋ธ” ์š”๊ตฌ์‚ฌํ•ญ ์กฐ๊ฑด ๋ฐ ์ถฉ์กฑ ์ฝ”๋“œ

  • student ํ…Œ์ด๋ธ” ์ƒ์„ฑ

    CREATE TABLE student (
    student_id number(38),
    student_name VARCHAR2(50),
    address VARCHAR2(255),
    phone VARCHAR2(30),
    student_email VARCHAR2(40)
    );

    ๊ธฐ๋ณธํ‚ค ์ œ์•ฝ์กฐ๊ฑด

    ALTER TABLE student ADD CONSTRAINT student_student_id_pk PRIMARY KEY(student_id);
    DESC student ON DELETE CASCADE;
  • lecture ํ…Œ์ด๋ธ” ์ƒ์„ฑ

    CREATE TABLE lecture(
    lecture_id number(38),
    lecture_name VARCHAR2(50),
    subject VARCHAR2(255),
    likes number(38),
    price number(38)
    );

    ๊ธฐ๋ณธํ‚ค ์ œ์•ฝ์กฐ๊ฑด

    ALTER TABLE lecture ADD CONSTRAINT lecture_lecture_id_pk PRIMARY KEY(lecture_id);
    DESC lecture ON DELETE CASCADE;

1) ๋ถ„์„ํ•จ์ˆ˜ 1๊ฐœ ์ด์ƒ ์ ์šฉ

  • ์ ์šฉ๊ฐ€๋Šฅํ•œ ๊ธฐ๋Šฅ

    ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์ž‘์„ฑํ•ด๋ณด๋ฉด ๊ณผ๋ชฉ๋ณ„ 1-3์œ„ ๊ฐ•์˜ ๋ชฉ๋ก ์ถ”์ถœ, ๊ฐ•์˜ ์ „์ฒด ์ค‘ 1-5์œ„ ๊ฐ•์˜ ๋ชฉ๋ก ์ถ”์ถœ, ์„ ์ƒ๋‹˜๋ณ„ ์ธ๊ธฐ ๊ฐ•์‚ฌ 1์œ„-3์œ„ ๋ชฉ๋ก ์ถ”์ถœ ROW_NUMBER(), RANK()

    • ์ธ๊ธฐ ๊ฐ•์˜ ๋ชฉ๋ก ์กฐํšŒ FindBestLectures : ROW_NUMBER() ํ•จ์ˆ˜

    : ๊ฐ•์˜ ์ „์ฒด ์ค‘ 1-5์œ„ ๊ฐ•์˜ ๋ชฉ๋ก ์ถ”์ถœ (์ผ๋‹จ 3๊ฐœ๋งŒ)

    SELECT lecture_id, name, subject, likes, price
    						FROM (SELECT  lecture_id, name, subject, likes, price,
    						ROW_NUMBER() OVER(ORDER BY likes DESC) AS ranking FROM lecture l)
    						WHERE ranking <= 3

2) DECODE, CASE๋ฌธ ์ ์šฉ

  • ์ ์šฉ๊ฐ€๋Šฅํ•œ ๊ธฐ๋Šฅ

    ์ข‹์•„์š” ์ˆ˜๊ฐ€ ๊ฐ€์žฅ ๋งŽ์€ ๊ฐ•์˜ โ†’ โ€œ์ธ๊ธฐ๊ฐ•์˜โ€ , ๊ทธ๋ ‡์ง€ ์•Š์€ ๊ฐ•์˜ โ†’ โ€œ๋งŒ์กฑ๋„๊ฐ€ ๋–จ์–ด์ง€๋Š” ๊ฐ•์˜โ€

    • ์ˆ˜๊ฐ•์ƒ์˜ ๊ฐ•์˜ ๊ฐ€๊ฒฉ ์ดํ•ฉ โ†’ ํšŒ์› ๋“ฑ๊ธ‰ ๊ตฌ๋ณ„ : getAllMyLecture

3) ๊ทธ๋ฃนํ•จ์ˆ˜ ์ ์šฉ

  • ์ ์šฉ๊ฐ€๋Šฅํ•œ ๊ธฐ๋Šฅ
    • discountPossible

4) ๊ธฐ๋ณธ CRUD์ ์šฉ

๊ฐ•์˜ ๋“ฑ๋ก, ๋ณ€๊ฒฝ, ์‚ญ์ œ, ์กฐํšŒ

์„ ์ƒ๋‹˜ ๋“ฑ๋ก, ๋ณ€๊ฒฝ

5) ๋ฉ”์†Œ๋“œ ์˜ค๋ฒ„๋กœ๋”ฉ ์ ์šฉ

์กด์žฌ ์œ ๋ฌด ํ™•์ธ ๋ฉ”์†Œ๋“œ๋‚˜

์กฐํšŒ ๊ธฐ๋Šฅ ๋ฉ”์†Œ๋“œ์— ์žˆ์–ด์„œ ์˜ค๋ฒ„๋กœ๋”ฉ ์ ์šฉ.

6) ์ƒ์„ฑ์ž ์˜ค๋ฒ„๋กœ๋”ฉ ์ ์šฉ

vo ํด๋ž˜์Šค ๋‚ด์—์„œ ์ƒ์„ฑ์ž ์˜ค๋ฒ„๋กœ๋”ฉ์„ ์ ์šฉ.

7) ์ˆซ์ž ๊ด€๋ จ ๊ฐ’์€ ์„ธ์ž๋ฆฌ์”ฉ , ๋กœ ๊ตฌ๋ถ„ํ•ด์„œ ์ถœ๋ ฅ

  • ์ ์šฉ๊ฐ€๋Šฅํ•œ ๊ธฐ๋Šฅ

    ๊ฐ•์˜ ์กฐํšŒ discountPossible

    ์•„์ด๋”” ๋ณ„ ๊ฐ•์˜ ์กฐํšŒ

    SELECT lecture_id, name,subject,likes,to_char(price,'999,999,999') FROM lecture WHERE lecture_id=?;

10. ํ”„๋กœ์ ํŠธ ์†Œ์Šค ์ฝ”๋“œ์™€ ์ถœ๋ ฅ๊ฒฐ๊ณผ

(1) DAO์™€ DAOImpl

  • DAO ์†Œ์Šค ์ฝ”๋“œ

    package com.edu.dao;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    
    import com.edu.vo.Lecture;
    import com.edu.vo.Student;
    import com.edu.vo.Teacher;
    import com.edu.vo.User;
    
    public interface EduDAO {
    
    	//๊ณตํ†ต ์ปค๋„ฅ์…˜ ์—ฐ๊ฒฐ๋ถ€
    	public Connection getConnection() throws SQLException;
    	
    	// ์กด์žฌ์—ฌ๋ถ€ ํ™•์ธ
    	//private boolean studentIdExist(int id);
    	//private boolean teacherIdExist(int id);
    	//private boolean lectureIdExist(int id);
    
    	//close ๋ฉ”์„œ๋“œ
    	public void closeAll(ResultSet rs, PreparedStatement ps, Connection conn) throws Exception;
    	public void closeAll(PreparedStatement ps, Connection conn) throws Exception;
    
    	//**๊ณตํ†ต ๊ธฐ๋Šฅ** (๊ฐ€๋นˆ)
    	public ArrayList<User> findAllTeacher() throws Exception;  //์„ ์ƒ๋‹˜ ์ „์ฒด ๋ชฉ๋ก ์กฐํšŒ
    	public ArrayList<User> findTeacherBySubject(String subject) throws Exception; //๊ณผ๋ชฉ๋ณ„ ์„ ์ƒ๋‹˜ ์ „์ฒด ๋ชฉ๋ก ์กฐํšŒ
    	public ArrayList<Lecture> findLectureByTeacher(int teacherId) throws Exception; //์„ ์ƒ๋‹˜ id๋กœ ๊ฐ•์˜ ๋ชฉ๋ก ์กฐํšŒ
    	public Lecture findLectureById(int lectureId) throws Exception; // ๊ฐ•์˜๋ช… id๋กœ ๊ฐ•์˜ ์กฐํšŒ
    	public ArrayList<Lecture> findBestLectures() throws Exception; // ์ธ๊ธฐ ๊ฐ•์˜ ๋ชฉ๋ก ์กฐํšŒ
    	//๊ณตํ†ต ๊ธฐ๋Šฅ ์ „๋ถ€ : throw IdNotFoundException -> IdExist ๋ฉ”์„œ๋“œ ํ˜ธ์ถœ ํ›„ ์กด์žฌํ•˜์ง€ ์•Š์œผ๋ฉด ์˜ˆ์™ธ 
    
    	//**๊ด€๋ฆฌ์ž** (์˜์šฑ)
    	public void addTeacher(Teacher teacher) throws Exception; 
    	// ์„ ์ƒ๋‹˜ ๋“ฑ๋ก -> ์ด๋ฉ”์ผ์ด ๋™์ผํ•˜๋ฉด throw AlreadyExistException 
    	
    	public void updateTeacher(Teacher teacher) throws Exception; // ์„ ์ƒ๋‹˜ ๋ณ€๊ฒฝ
    	public void deleteTeacher(int teacherId) throws Exception; // ์„ ์ƒ๋‹˜ ์‚ญ์ œ
    	//์œ„ ๋‘๊ฐœ ๋ฉ”์„œ๋“œ ์ „๋ถ€ : throw IdNotFoundException -> IdExist ๋ฉ”์„œ๋“œ ํ˜ธ์ถœ ํ›„ ์กด์žฌํ•˜์ง€ ์•Š์œผ๋ฉด ์˜ˆ์™ธ 
    
    	//**๊ฐ•์˜์ž** (์†กํฌ)
    	public void addLecture(Lecture lecture) throws Exception; 
    	
    	public void updateLecture(Lecture lecture) throws Exception;
    	//throw IdNotFoundException
    	
    
    	//**์ˆ˜๊ฐ•์ž**
    	//(์†กํฌ)
    	public ArrayList<Student> getAllStudents() throws Exception;
    	public String getStudentLectures(int studentId) throws Exception;
    	public ArrayList<Lecture> getAllMyLecture(int studentId) throws Exception; // id๋กœ ์ˆ˜๊ฐ•์ž ๊ฐ•์˜ ๋ชฉ๋ก์กฐํšŒ
    	// throw IdNotFoundException
    
    	public void applyLecture(int studentId, Lecture lecture) throws Exception; 
    	//์ˆ˜๊ฐ•์ž ๊ฐ•์˜ ๋ชฉ๋ก์— ๊ฐ•์˜ ์ถ”๊ฐ€ -> getAllMyLecture ๋ฉ”์„œ๋“œ ํ˜ธ์ถœํ•ด์„œ ๊ฐ•์˜ ๋ชฉ๋ก ์ถœ๋ ฅ
    	// throw AlreadyExistException 
    
    	public void cancleLecture(int studentId, Lecture lecture) throws Exception; // ์ˆ˜๊ฐ•์ž ๊ฐ•์˜ ๋ชฉ๋ก์—์„œ ๊ฐ•์˜ ์‚ญ์ œ
    	// throw IdNotFoundException
    
    	//(์˜์šฑ)
    	public boolean likePossible(int studentId, int lectureId) throws Exception; // ์ˆ˜๊ฐ•์ž๊ฐ€ ๊ฐ•์˜ ์ข‹์•„์š” ๊ฐ€๋Šฅ ์—ฌ๋ถ€ ํ™•์ธ
    	// throw IdNotFoundException( ์ˆ˜๊ฐ•์ž id๋ž‘ ๊ฐ•์˜ id ๋‘˜๋‹ค ํ™•์ธ)
    
    	public void likeLecture(int studentId, int lectureId) throws Exception; // ๊ฐ•์˜ id๋กœ ์ข‹์•„์š” ํ‘œ์‹œ
    	// likePossible ํ˜ธ์ถœํ•ด์„œ true ์ด๋ฉด likeLecture ํ˜ธ์ถœ
    	// likePossible ํ˜ธ์ถœํ•ด์„œ false์ด๋ฉด ๋ฉ”์„œ๋“œ ๋‚˜๊ฐ€๊ธฐ
    
    	//public boolean discountPossible(int studentId, int teacherId);
    	// ์„ ์ƒ๋‹˜ ๊ฐ•์˜๋ฅผ ์ˆ˜๊ฐ•์ž๊ฐ€ 3๊ฐœ ์ด์ƒ ์ˆ˜๊ฐ• ์ค‘์ด๋ฉด ๊ฐ•์˜ ํ• ์ธ
    	// throw IdNotFoundException
    	
    	public int discountLecture(String subject, int discount) throws Exception;
    	//ํŠน์ • subject์˜ ๊ฐ€๊ฒฉ ์ด ํ•ฉ์— ํ• ์ธ์œจ์„ ์ ์šฉํ•˜์—ฌ ํŒจํ‚ค์ง€ ๊ฐ€๊ฒฉ์„ ์•Œ๋ ค์ค€๋‹ค.
    	//SELECT SUM(price) FROM lecture WHERE subject='์ˆ˜ํ•™';
    	
    }
  • DAOImpl ์†Œ์Šค์ฝ”๋“œ

    package com.edu.dao.impl;
    
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    
    import com.edu.dao.EduDAO;
    import com.edu.exception.AlreadyExistException;
    import com.edu.exception.IdNotFoundException;
    import com.edu.vo.Lecture;
    import com.edu.vo.Teacher;
    import com.edu.vo.User;
    
    import config.ServerInfo;
    
    public class EduDAOImpl implements EduDAO {
    
    	private static EduDAOImpl dao = new EduDAOImpl();
    	
    	private EduDAOImpl() {
    		System.out.println("EduDAOImpl Creating...Using Singletone");
    	}
    	public static EduDAOImpl getInstance() {
    		return dao;
    	}
    	
    	@Override
    	public Connection getConnection() throws SQLException {
    		Connection conn = DriverManager.getConnection(ServerInfo.URL, ServerInfo.USER, ServerInfo.PASSWORD);
    		System.out.println("DB Connect...");
    		return conn;
    	}
    	
    	private boolean teacherIdExist(int id, Connection conn) throws SQLException {
    		String query = "SELECT teacher_id FROM teacher WHERE teacher_id=?";
    		PreparedStatement ps = conn.prepareStatement(query);
    		ps.setInt(1, id);
    		ResultSet rs = ps.executeQuery();
    		return rs.next();
    	}
    	
    	private boolean lectureIdExist(int id, Connection conn) throws SQLException {
    		String query = "SELECT lecture_id FROM lecture WHERE lecture_id=?";
    		PreparedStatement ps = conn.prepareStatement(query);
    		ps.setInt(1, id);
    		ResultSet rs = ps.executeQuery();
    		return rs.next();
    	}
    	
    	//๊ฐ€๋นˆ ์ฝ”๋“œ
    	private boolean lectureSubjectExist(String subject,Connection conn)throws SQLException{
            PreparedStatement ps = null;
            ResultSet rs = null;
    
            String query = "SELECT subject FROM lecture WHERE subject=?";
            ps = conn.prepareStatement(query);
            ps.setString(1, subject);
            rs = ps.executeQuery();
            return rs.next();
        }
    	
    	//์†กํฌ ์ฝ”๋“œ
    	private boolean studentIdExist(int id, Connection conn) throws SQLException {
            String query = "SELECT STUDENT_ID FROM STUDENT WHERE STUDENT_ID = ?";
            PreparedStatement ps = conn.prepareStatement(query);
            ps.setInt(1, id);
            ResultSet rs = ps.executeQuery();
            
            boolean flag=  rs.next();
            System.out.println("์ˆ˜๊ฐ•์ž ์•„์ด๋”” ์กฐํšŒ๊ฒฐ๊ณผ :  "+ flag);
            return flag;
        }
    	
    	private boolean learningIdExist(int lectureId, int studentId, Connection conn) throws SQLException {
            String query = "SELECT DISTINCT student_id FROM learning WHERE student_id = ? AND lecture_id = ?";
            PreparedStatement ps = conn.prepareStatement(query);
            ps.setInt(1, studentId);
            ps.setInt(2, lectureId);
            ResultSet rs = ps.executeQuery();
            
            boolean flag=  rs.next();
            System.out.println("๊ต์œก ํ…Œ์ด๋ธ” ์•„์ด๋”” ์กฐํšŒ๊ฒฐ๊ณผ :  "+ flag);
            return flag;
        }
    	
    	private boolean learningIdExist(int studentId, Connection conn) throws SQLException {
            String query = "SELECT DISTINCT student_id FROM learning WHERE student_id = ?";
            PreparedStatement ps = conn.prepareStatement(query);
            ps.setInt(1, studentId);
            ResultSet rs = ps.executeQuery();
            
            boolean flag=  rs.next();
            System.out.println("๊ต์œก ํ…Œ์ด๋ธ” ์•„์ด๋”” ์กฐํšŒ๊ฒฐ๊ณผ :  "+ flag);
            return flag;
        }
    
    	@Override
    	public void closeAll(ResultSet rs, PreparedStatement ps, Connection conn) throws Exception {
    		if(rs!=null) rs.close();
    		closeAll(ps, conn);
    	}
    
    	@Override
    	public void closeAll(PreparedStatement ps, Connection conn) throws Exception {
    		if(ps!=null) ps.close();
    		if(conn!=null) conn.close();
    	}
    
    	/////////////////////////// ๊ณตํ†ต ๊ธฐ๋Šฅ //////////////////////////////
    	@Override
    	public ArrayList<User> findAllTeacher() throws Exception{
    	    Connection conn = null;
    	    PreparedStatement ps = null;
    	    ResultSet rs = null;
    	    
    	    ArrayList<User> list = new ArrayList<User>();
    	    try {
    	        conn = getConnection();
    	        String query ="SELECT teacher_id, name, email,subject FROM teacher";
    	        ps = conn.prepareStatement(query);
    	        rs = ps.executeQuery();
    	        
    	        while(rs.next()){
    	            list.add(new Teacher(rs.getInt("teacher_id"), 
    	                    rs.getString("name"), 
    	                    rs.getString("email"),
    	                    rs.getString("subject")
    	                    ));
    	        }
    	        
    	    }finally {
    	        closeAll(rs, ps, conn);
    	    }
    	    return list;
    	}
    	
    	@Override
    	public ArrayList<User> findTeacherBySubject(String subject) throws Exception {
    	    Connection conn = null;
    	    PreparedStatement ps = null;
    	    ResultSet rs = null;
    	    
    	    ArrayList<User> list = new ArrayList<User>();
    	    try {
    	        conn = getConnection();
    	        if(lectureSubjectExist(subject,conn)) {
    	            String query ="SELECT teacher_id, name, email,subject FROM teacher WHERE subject=?";
    	            ps = conn.prepareStatement(query);
    	            ps.setString(1, subject);
    	            rs = ps.executeQuery();
    	            
    	            while(rs.next()){
    	                list.add(new Teacher(rs.getInt("teacher_id"), 
    	                        rs.getString("name"), 
    	                        rs.getString("email"),
    	                        rs.getString("subject")
    	                        ));
    	            }
    	        }else {
    	            throw new IdNotFoundException("ํ•ด๋‹น ๊ณผ๋ชฉ์„ ๋‹ด๋‹นํ•˜๋Š” ์„ ์ƒ๋‹˜์ด ์—†์Šต๋‹ˆ๋‹ค.");
    	        }
    	        
    	    }finally {
    	        closeAll(rs, ps, conn);
    	    }
    	    return list;
    	}
    	
    	@Override
    	public ArrayList<Lecture> findLectureByTeacher(int teacherId) throws Exception {
    	    Connection conn = null;
    	    PreparedStatement ps = null;
    	    ResultSet rs = null;
    	    
    	    ArrayList<Lecture> list = new ArrayList<Lecture>();
    	    
    	    try {
    	        conn = getConnection();
    	        if(teacherIdExist(teacherId,conn)) {
    	            String query ="SELECT lecture_id,name,subject,likes,to_char(price,'9,999,999') FROM lecture WHERE lecture_id in (SELECT lecture_id FROM education where teacher_id=?)";
    	            ps = conn.prepareStatement(query);
    	            ps.setInt(1, teacherId);
    	            rs = ps.executeQuery();
    	            
    	            while(rs.next()) {
    	                list.add(new Lecture(rs.getInt("lecture_id"), 
    	                        rs.getString("name"), 
    	                        rs.getString("subject"),
    	                        rs.getInt("likes"),
    	                        rs.getString("to_char(price,'9,999,999')")
    	                        ));
    	            }
    	        }else {
    	            throw new IdNotFoundException("๋“ฑ๋ก๋œ ์„ ์ƒ๋‹˜์ด ์•„๋‹™๋‹ˆ๋‹ค.");
    	        }
    
    	    }finally {
    	        closeAll(rs, ps, conn);
    	    }
    	    return list;
    	}
    	
    	@Override
    	public Lecture findLectureById(int lectureId) throws Exception  {
    	    Connection conn = null;
    	    PreparedStatement ps = null;
    	    ResultSet rs = null;
    
    	    Lecture lecture = new Lecture();
    	    try {
    	        conn = getConnection();
    	        if(lectureIdExist(lectureId,conn)) {
    	            String query ="SELECT lecture_id, name,subject,likes,to_char(price,'9,999,999') FROM lecture WHERE lecture_id=?";
    	            ps = conn.prepareStatement(query);
    	            ps.setInt(1, lectureId);
    	            rs = ps.executeQuery();
    	            
    	            if(rs.next()){
    	                lecture.setId(lectureId);
    	                lecture.setName(rs.getString("name"));
    	                lecture.setSubject(rs.getString("subject"));
    	                lecture.setLikes( rs.getInt("likes"));
    	                lecture.setPrice(rs.getString("to_char(price,'9,999,999')"));
    	            }
    	        }else {
    	            throw new IdNotFoundException("์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฐ•์˜์ž…๋‹ˆ๋‹ค.");
    	        }
    	        
    	    }finally {
    	        closeAll(rs, ps, conn);
    	    }
    	    return lecture;
    	}
    	
    	@Override
    	public ArrayList<Lecture> findBestLectures() throws Exception {
    	    Connection conn = null;
    	    PreparedStatement ps = null;
    	    ResultSet rs = null;
    	    
    	    ArrayList<Lecture> list = new ArrayList<Lecture>();
    	    
    	    try {
    	            conn = getConnection();
    	            String query ="SELECT lecture_id, name, subject, likes, to_char(price,'9,999,999')"
    	                    + "FROM (SELECT  lecture_id, name, subject, likes, price, "
    	                    + "ROW_NUMBER() OVER(ORDER BY likes DESC) AS ranking FROM lecture l) "
    	                    + "WHERE ranking <= 3";
    	            ps = conn.prepareStatement(query);
    	            rs = ps.executeQuery();
    	            
    	            while(rs.next()) {
    	                list.add(new Lecture(rs.getInt("lecture_id"), 
    	                        rs.getString("name"), 
    	                        rs.getString("subject"),
    	                        rs.getInt("likes"),
    	                        rs.getString("to_char(price,'9,999,999')")
    	                        ));
    	            }
    	    }finally {
    	        closeAll(rs, ps, conn);
    	    }
    	    return list;
    	}
    
    	/////////////////////////// ๊ด€๋ฆฌ์ž ๊ธฐ๋Šฅ (์˜์šฑ) ///////////////////////
    	@Override
    	public void addTeacher(Teacher teacher) throws Exception {
    		Connection conn = null;
            PreparedStatement ps = null;
            try {
                conn = getConnection();
                if(!teacherIdExist(teacher.getId(), conn)) { //๋“ฑ๋กํ•˜๋ ค๋Š” ๊ฐ•์˜์ž๊ฐ€ ์•„์ง ์—†์œผ๋ฉด
                    String query = "INSERT INTO teacher(teacher_id, name, email, subject) VALUES(seq_teacher.nextVal,?,?,?)";
                    ps=  conn.prepareStatement(query);
                    ps.setString(1, teacher.getName());
                    ps.setString(2, teacher.getEmail());
                    ps.setString(3, teacher.getSubject());
                    System.out.println(ps.executeUpdate()+" ๋ช… INSERT ์„ฑ๊ณต...addTeacher()..");
                }else {
                    throw new AlreadyExistException();
                }
            }finally {
                closeAll(ps, conn);
            }
    	}
    
    	@Override
    	public void updateTeacher(Teacher teacher) throws Exception {
    		Connection conn = null;
            PreparedStatement ps = null;
            try {
                conn = getConnection();
                String query = "UPDATE teacher SET name=?, email=?, subject=? WHERE teacher_id=?";
                ps = conn.prepareStatement(query);
                ps.setString(1, teacher.getName());
                ps.setString(2, teacher.getEmail());
                ps.setString(3, teacher.getSubject());
                ps.setInt(4, teacher.getId());
    
                int row = ps.executeUpdate();
                if(row==1)System.out.println(row+" ๋ช… UPDATE OK...updateTeacher()...");
                else throw new IdNotFoundException("์ˆ˜์ •ํ•  ๊ฐ•์˜์ž๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค");
            }finally {
                closeAll(ps, conn);
            }
    	}
    
    	@Override
    	public void deleteTeacher(int teacherId) throws Exception {
    		Connection conn = null;
            PreparedStatement ps = null;
            try {
                conn = getConnection();
                if(teacherIdExist(teacherId, conn)) { //ํ•ด๋‹น ๊ฐ•์˜์ž ์กด์žฌํ•˜๋ฉด ์‚ญ์ œ
                    String query = "DELETE teacher WHERE teacher_id=?";
                    ps = conn.prepareStatement(query);
                    ps.setInt(1, teacherId);
    
                    System.out.println(ps.executeUpdate()+" ๋ช… DELETE OK...deleteTeacher()..");
                }else {
                    throw new IdNotFoundException("์‚ญ์ œํ•  ๊ฐ•์˜์ž๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค ");
                }
            }finally {
                closeAll(ps, conn);
            }
    	}
    	/////////////////////////// ๊ด€๋ฆฌ์ž ๊ธฐ๋Šฅ (์˜์šฑ) ///////////////////////
    
    	@Override
        public void addLecture(Lecture lecture) throws Exception {
            Connection conn = null;
            PreparedStatement ps = null;
            
            try {
                
                conn = getConnection();
                String query = "INSERT INTO lecture(lecture_id, name, subject, likes, price) VALUES (seq_lecture.nextVal, ?, ?, ?, ?)";
                ps = conn.prepareStatement(query);
                ps.setString(1, lecture.getName());
                ps.setString(2, lecture.getSubject());
                ps.setInt(3, lecture.getLikes());
                ps.setString(4, lecture.getPrice());
                
                System.out.println(ps.executeUpdate()+ "๊ฐœ ๊ฐ•์˜ ๋“ฑ๋ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
                
            }finally {
                closeAll(ps, conn);
            }
            
        }
    	
    	@Override
        public void updateLecture(Lecture lecture) throws Exception {
            Connection conn = null;
            PreparedStatement ps = null;
            
            try {
                conn = getConnection();
                if(lectureIdExist(lecture.getId(), conn)) {
                    
                    String query = "UPDATE lecture SET name = ?, subject = ?, price = ? WHERE lecture_id = ?";
                    ps = conn.prepareStatement(query);
                    ps.setString(1, lecture.getName());
                    ps.setString(2, lecture.getSubject());
                    ps.setString(3, lecture.getPrice());
                    ps.setInt(4, lecture.getId());
                    
                    System.out.println(ps.executeUpdate()+ "๊ฐœ ๊ฐ•์˜๊ฐ€ ์ˆ˜์ •๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
                    
                }else {
                    throw new IdNotFoundException("์กด์žฌํ•˜๋Š” lecture id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                }
                
            }finally {
                closeAll(ps, conn);
            }
            
        }
    	
    	@Override
        public ArrayList<Lecture> getAllMyLecture(int studentId) throws Exception {
            
            Connection conn = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            
            ArrayList<Lecture> list = new ArrayList<>();
            
            try {
                conn = getConnection();
                
                
                if(studentIdExist(studentId, conn)){
                    if(learningIdExist(studentId, conn)) {
                        conn = getConnection();
                        String query = "SELECT lecture.lecture_id AS id, lecture.name AS name, lecture.subject AS subject, lecture.likes AS likes, lecture.price AS price" +
                                " FROM learning, lecture" +
                                " WHERE learning.lecture_id = lecture.lecture_id AND learning.student_id = ?";
                        ps = conn.prepareStatement(query);
                        ps.setInt(1, studentId);
                        
                        rs = ps.executeQuery();
                        
                        while(rs.next()) {
                            list.add(new Lecture(
                                    rs.getInt("id"),
                                    rs.getString("name"), 
                                    rs.getString("subject"), 
                                    rs.getInt("likes"), 
                                    rs.getString("price")));
                        }
                    }
                }else{
                    throw new IdNotFoundException("์กด์žฌํ•˜๋Š” student id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                }
                
                
            }finally {
                closeAll(rs, ps, conn);
            }
            
            return list;
        }
    	
    	@Override
        public void applyLecture(int studentId, Lecture lecture) throws Exception  {
            Connection conn = null;
            PreparedStatement ps = null;
            System.out.println("ํ•™์ƒ์•„์ด๋”” "+studentId);
            try {
                conn = getConnection();
                if(studentIdExist(studentId, conn)) {
                    if(!learningIdExist(lecture.getId(), studentId, conn)) {
                        conn = getConnection();
                        String query = "INSERT INTO learning(student_id, lecture_id, flag) VALUES(?, ?, ?)";
                        ps = conn.prepareStatement(query);
                        ps.setInt(1, studentId);
                        ps.setInt(2, lecture.getId());
                        ps.setInt(3, 0);
                        
                        System.out.println(ps.executeUpdate()+"๊ฐœ ๊ฐ•์˜๊ฐ€ ์ง€์›๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
                    }else {
                        System.out.println("์ด๋ฏธ ์ˆ˜๊ฐ•์‹ ์ฒญํ•œ ์ด๋ ฅ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.");
                    }
                }else {
                    throw new IdNotFoundException("์กด์žฌํ•˜๋Š” student id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                }
                
            }finally {
                closeAll(ps, conn);
            }
            
            
        }
    	
    	@Override
        public void cancleLecture(int studentId, Lecture lecture) throws Exception {
            Connection conn = null;
            PreparedStatement ps = null;
            
            try {
                conn = getConnection();
                if(learningIdExist(lecture.getId(),studentId, conn)) {
                    conn = getConnection();
                    String query = "DELETE learning WHERE student_id = ? AND lecture_id = ?";
                    ps = conn.prepareStatement(query);
                    ps.setInt(1, studentId);
                    ps.setInt(2, lecture.getId());
                    
                    System.out.println(ps.executeUpdate()+"๊ฐœ ๊ฐ•์˜๊ฐ€ ์ทจ์†Œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
                    getAllMyLecture(studentId);
                    
                }else {
                    throw new IdNotFoundException("์กด์žฌํ•˜๋Š” student id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                }
                
            }finally {
                closeAll(ps, conn);
            }
            
        }
    
    	/////////////////////////// ๊ด€๋ฆฌ์ž ๊ธฐ๋Šฅ (์˜์šฑ) ///////////////////////
    	@Override
    	public boolean likePossible(int studentId, int lectureId) throws Exception {
    		//๊ฐ•์˜-ํ•™์ƒ -> learning
    		//๋งŒ์•ฝ learning์˜ flag ๊ฐ’์ด 0์ด๋ฉด -> ์ข‹์•„์š” ๋ˆ„๋ฅด๊ธฐ ๊ฐ€๋Šฅ, true ๋ฆฌํ„ด
    		//๋งŒ์•ฝ learning์˜ flag ๊ฐ’์ด 1์ด๋ฉด -> ์ข‹์•„์š” ๋ˆ„๋ฅด๊ธฐ ๋ถˆ๊ฐ€๋Šฅ, false ๋ฆฌํ„ด
    		boolean flag = false;
    		
    		Connection conn = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            try {
            	conn = getConnection();
            	String query = "SELECT flag FROM learning WHERE student_id=? and lecture_id=?";
            	ps = conn.prepareStatement(query);
            	ps.setInt(1, studentId);
            	ps.setInt(2, lectureId);
            	rs = ps.executeQuery();
            	if(rs.next()) {
            		if(rs.getInt("flag")==0)
            			flag = true;
            	}
            } finally {
            	closeAll(rs, ps, conn);
            }
    		
    		return flag;
    	}
    	// ์ˆ˜๊ฐ•์ž๊ฐ€ ๊ฐ•์˜ ์ข‹์•„์š” ๊ฐ€๋Šฅ ์—ฌ๋ถ€ ํ™•์ธ
    	// throw IdNotFoundException( ์ˆ˜๊ฐ•์ž id๋ž‘ ๊ฐ•์˜ id ๋‘˜๋‹ค ํ™•์ธ)
    
    	private void setFlag(int studentId, int lectureId) throws Exception {
    		//learning ํ…Œ์ด๋ธ”์˜ flag 0->1
    		Connection conn = null;
    		PreparedStatement ps = null;
    		try {
    			conn = getConnection();
    		    String query = "UPDATE learning SET flag=? WHERE student_id=? and lecture_id=?";
    		    ps = conn.prepareStatement(query);
    		    ps.setInt(1, 1);
    		    ps.setInt(2, studentId);
    		    ps.setInt(3, lectureId);
    
    		    int row = ps.executeUpdate();
    		    if(row==1)System.out.println("flag ๋ณ€๊ฒฝ ์„ฑ๊ณต");
    		    else throw new IdNotFoundException("flag ๋ณ€๊ฒฝํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค");
    	   }finally {
    		   closeAll(ps, conn);
    		   }
    	}
    	
    	//ํŠน์ • ๊ฐ•์˜์˜ ์ธ๊ธฐ๋„ ๊ฐ€์ ธ์˜ค๊ธฐ
    	public int getLikes(int lectureId) throws Exception {
    		Connection conn = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            int likes = 0;
            try {
            	conn = getConnection();
                if(lectureIdExist(lectureId, conn)) { //๊ฐ•์˜ ์กด์žฌํ•˜๋ฉด ์ธ๊ธฐ๋„ ๊ฐ€์ ธ์˜ค๊ธฐ
                	String query = "SELECT likes FROM lecture WHERE lecture_id=?";
                	ps = conn.prepareStatement(query);
                	ps.setInt(1, lectureId);
                	rs = ps.executeQuery();
                	if(rs.next()) {
                		likes = rs.getInt("likes");
                	}
                }else {
                    throw new IdNotFoundException("์ธ๊ธฐ๋„๋ฅผ ๊ฐ€์ ธ์˜ฌ ๊ฐ•์˜๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค ");
                }
            } finally {
            	closeAll(rs, ps, conn);
            }
    		return likes;
    	}
    	
    	@Override
    	public void likeLecture(int studentId, int lectureId) throws Exception {
    		
    		if(!likePossible(studentId, lectureId))
    			return; //์ข‹์•„์š” ๋ˆ„๋ฅด๊ธฐ ๋ถˆ๊ฐ€๋Šฅํ•˜๋ฉด ๋
    		
    		int nowLikes = getLikes(lectureId);
    		//ํ˜„์žฌ ์ธ๊ธฐ๋„+1 -> db์— ์—…๋ฐ์ดํŠธ
    		Connection conn = null;
            PreparedStatement ps = null;
            try {
                conn = getConnection();
                String query = "UPDATE lecture SET likes=? WHERE lecture_id=?";
                ps = conn.prepareStatement(query);
                ps.setInt(1, nowLikes+1);
                ps.setInt(2, lectureId);
    
                int row = ps.executeUpdate();
                if(row==1)System.out.println("์ธ๊ธฐ๋„ ์˜ฌ๋ฆฌ๊ธฐ ์„ฑ๊ณต");
                else throw new IdNotFoundException("์ธ๊ธฐ๋„ ์˜ฌ๋ฆด ๊ฐ•์˜๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค");
            }finally {
                closeAll(ps, conn);
            }
            
            //flag 0->1๋กœ
            setFlag(studentId, lectureId);
    	}
    
    	@Override
    	public int discountLecture(String subject, int discount) throws Exception {
    		//ํŠน์ • subject์˜ ๊ฐ€๊ฒฉ ์ด ํ•ฉ์— ํ• ์ธ์œจ์„ ์ ์šฉํ•˜์—ฌ ํŒจํ‚ค์ง€ ๊ฐ€๊ฒฉ์„ ์•Œ๋ ค์ค€๋‹ค.
    		//SELECT SUM(price) FROM lecture WHERE subject='์ˆ˜ํ•™';
    		Connection conn = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            int total = 0;
            try {
            	conn = getConnection();
                String query = "SELECT SUM(price) FROM lecture WHERE subject=?";
                ps = conn.prepareStatement(query);
                ps.setString(1, subject);
                rs = ps.executeQuery();
                if(rs.next()) {
                	total = rs.getInt("SUM(price)");
                }
            } finally {
            	closeAll(rs, ps, conn);
            }
    		return total/discount;
    	}
    
    	
    	/////////////////////////// ๊ด€๋ฆฌ์ž ๊ธฐ๋Šฅ (์˜์šฑ) ///////////////////////
    }

(2) ์„ ์ƒ๋‹˜ ์ „์ฒด ์กฐํšŒ

  • ์†Œ์Šค ์ฝ”๋“œ

    @Override
    public ArrayList<User> findAllTeacher() throws Exception{
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        
        ArrayList<User> list = new ArrayList<User>();
        try {
            conn = getConnection();
            String query ="SELECT teacher_id, name, email,subject FROM teacher";
            ps = conn.prepareStatement(query);
            rs = ps.executeQuery();
            
            while(rs.next()){
                list.add(new Teacher(rs.getInt("teacher_id"), 
                        rs.getString("name"), 
                        rs.getString("email"),
                        rs.getString("subject")
                        ));
            }
            
        }finally {
            closeAll(rs, ps, conn);
        }
        return list;
    }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(3) ๊ณผ๋ชฉ๋ณ„ ์„ ์ƒ๋‹˜ ์กฐํšŒ

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    public ArrayList<User> findTeacherBySubject(String subject) throws Exception {
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        
        ArrayList<User> list = new ArrayList<User>();
        try {
            conn = getConnection();
            if(lectureSubjectExist(subject,conn)) {
                String query ="SELECT teacher_id, name, email,subject FROM teacher WHERE subject=?";
                ps = conn.prepareStatement(query);
                ps.setString(1, subject);
                rs = ps.executeQuery();
                
                while(rs.next()){
                    list.add(new Teacher(rs.getInt("teacher_id"), 
                            rs.getString("name"), 
                            rs.getString("email"),
                            rs.getString("subject")
                            ));
                }
            }else {
                throw new IdNotFoundException("ํ•ด๋‹น ๊ณผ๋ชฉ์„ ๋‹ด๋‹นํ•˜๋Š” ์„ ์ƒ๋‹˜์ด ์—†์Šต๋‹ˆ๋‹ค.");
            }
            
        }finally {
            closeAll(rs, ps, conn);
        }
        return list;
    }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(4) ์„ ์ƒ๋‹˜๋ณ„ ๊ฐ•์˜ ์กฐํšŒ

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    public ArrayList<Lecture> findLectureByTeacher(int teacherId) throws Exception {
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        
        ArrayList<Lecture> list = new ArrayList<Lecture>();
        
        try {
            conn = getConnection();
            if(teacherIdExist(teacherId,conn)) {
                String query ="SELECT lecture_id,name,subject,likes,to_char(price,'9,999,999') FROM lecture WHERE lecture_id in (SELECT lecture_id FROM education where teacher_id=?)";
                ps = conn.prepareStatement(query);
                ps.setInt(1, teacherId);
                rs = ps.executeQuery();
                
                while(rs.next()) {
                    list.add(new Lecture(rs.getInt("lecture_id"), 
                            rs.getString("name"), 
                            rs.getString("subject"),
                            rs.getInt("likes"),
                            rs.getString("to_char(price,'9,999,999')")
                            ));
                }
            }else {
                throw new IdNotFoundException("๋“ฑ๋ก๋œ ์„ ์ƒ๋‹˜์ด ์•„๋‹™๋‹ˆ๋‹ค.");
            }
    
        }finally {
            closeAll(rs, ps, conn);
        }
        return list;
    }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(5) ๊ฐ•์˜ id๋กœ ๊ฐ•์˜ ์กฐํšŒ

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    public Lecture findLectureById(int lectureId) throws Exception  {
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
    
        Lecture lecture = new Lecture();
        try {
            conn = getConnection();
            if(lectureIdExist(lectureId,conn)) {
                String query ="SELECT lecture_id, name,subject,likes,to_char(price,'9,999,999') FROM lecture WHERE lecture_id=?";
                ps = conn.prepareStatement(query);
                ps.setInt(1, lectureId);
                rs = ps.executeQuery();
                
                if(rs.next()){
                    lecture.setId(lectureId);
                    lecture.setName(rs.getString("name"));
                    lecture.setSubject(rs.getString("subject"));
                    lecture.setLikes( rs.getInt("likes"));
                    lecture.setPrice(rs.getString("to_char(price,'9,999,999')"));
                }
            }else {
                throw new IdNotFoundException("์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฐ•์˜์ž…๋‹ˆ๋‹ค.");
            }
            
        }finally {
            closeAll(rs, ps, conn);
        }
        return lecture;
    }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(6) ์ธ๊ธฐ ๊ฐ•์˜ ๋ชฉ๋ก ์กฐํšŒ

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    public ArrayList<Lecture> findBestLectures() throws Exception {
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        
        ArrayList<Lecture> list = new ArrayList<Lecture>();
        
        try {
                conn = getConnection();
                String query ="SELECT lecture_id, name, subject, likes, to_char(price,'9,999,999')"
                        + "FROM (SELECT  lecture_id, name, subject, likes, price, "
                        + "ROW_NUMBER() OVER(ORDER BY likes DESC) AS ranking FROM lecture l) "
                        + "WHERE ranking <= 3";
                ps = conn.prepareStatement(query);
                rs = ps.executeQuery();
                
                while(rs.next()) {
                    list.add(new Lecture(rs.getInt("lecture_id"), 
                            rs.getString("name"), 
                            rs.getString("subject"),
                            rs.getInt("likes"),
                            rs.getString("to_char(price,'9,999,999')")
                            ));
                }
        }finally {
            closeAll(rs, ps, conn);
        }
        return list;
    }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(7) ๊ฐ•์˜ ์ •๋ณด ์ถ”๊ฐ€

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    public void addLecture(Lecture lecture) throws Exception {
        Connection conn = null;
        PreparedStatement ps = null;
        
        try {
            
            conn = getConnection();
            String query = "INSERT INTO lecture(lecture_id, name, subject, likes, price) VALUES (seq_lecture.nextVal, ?, ?, ?, ?)";
            ps = conn.prepareStatement(query);
            ps.setString(1, lecture.getName());
            ps.setString(2, lecture.getSubject());
            ps.setInt(3, lecture.getLikes());
            ps.setString(4, lecture.getPrice());
            
            System.out.println(ps.executeUpdate()+ "๊ฐœ ๊ฐ•์˜ ๋“ฑ๋ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
            
        }finally {
            closeAll(ps, conn);
        }
        
    }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(8) ๊ฐ•์˜ ์ •๋ณด ์ˆ˜์ •

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    public void updateLecture(Lecture lecture) throws Exception {
        Connection conn = null;
        PreparedStatement ps = null;
        
        try {
            conn = getConnection();
            if(lectureIdExist(lecture.getId(), conn)) {
                
                String query = "UPDATE lecture SET name = ?, subject = ?, price = ? WHERE lecture_id = ?";
                ps = conn.prepareStatement(query);
                ps.setString(1, lecture.getName());
                ps.setString(2, lecture.getSubject());
                ps.setString(3, lecture.getPrice());
                ps.setInt(4, lecture.getId());
                
                System.out.println(ps.executeUpdate()+ "๊ฐœ ๊ฐ•์˜๊ฐ€ ์ˆ˜์ •๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
                
            }else {
                throw new IdNotFoundException("์กด์žฌํ•˜๋Š” lecture id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
            }
            
        }finally {
            closeAll(ps, conn);
        }
        
    }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(9) ๊ฐ•์˜ ์ˆ˜๊ฐ• ์ด์•ก๊ณผ ๊ฐ•์˜๋ชฉ๋ก ์กฐํšŒ

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    	public ArrayList<Student> getAllStudents() throws Exception {
    		
    		Connection conn = null;
    		PreparedStatement ps = null;
    		ResultSet rs = null;
    		
    		ArrayList<Student> list = new ArrayList<Student>();
    		
    		try {
    			conn = getConnection();
    			
    			String query = "SELECT student_id, name, address, phone, email" +
    					" FROM student";
    			ps = conn.prepareStatement(query);
    			
    			rs = ps.executeQuery();
    			
    			while(rs.next()) {
    				list.add(new Student(rs.getInt("student_id"), 
    						rs.getString("name"), 
    						rs.getString("address"), 
    						rs.getString("phone"),
    						rs.getString("email")
    						));
    			}
    			
    		}finally {
    			closeAll(rs, ps, conn);
    		}
    		
    		return list;
    	}
    	
    	@Override
    	public String getStudentLectures(int studentId) throws Exception{
    		Connection conn = null;
    		PreparedStatement ps = null;
    		ResultSet rs = null;
    		
    		String sumPrice = "";
    		
    		try {
    			conn = getConnection();
    			
    			
    			if(studentIdExist(studentId, conn)){
    				if(learningIdExist(studentId, conn)) {
    					conn = getConnection();
    					String query = "SELECT TO_CHAR(SUM(price), 'FM999,999,999,999') AS price, id"
    							+ " FROM" 
    							+ " (SELECT lecture.name AS name, lecture.subject AS subject, lecture.likes AS likes, lecture.price AS price, learning.student_id AS id"
    							+ " FROM learning, lecture" 
    							+ " WHERE learning.lecture_id = lecture.lecture_id AND learning.student_id = ?)" 
    							+ " GROUP BY id";
    					ps = conn.prepareStatement(query);
    					ps.setInt(1, studentId);
    					
    					rs = ps.executeQuery();
    					
    					if(rs.next()) {
    						sumPrice = rs.getString("price");
    					}
    				}
    			}else{
    				throw new IdNotFoundException("์กด์žฌํ•˜๋Š” student id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
    			}
    			
    			
    		}finally {
    			closeAll(rs, ps, conn);
    		}
    		
    		if(sumPrice.equals("")) {
    			sumPrice = "0";
    		}
    		
    		return sumPrice;
    	}
    	
    	@Override
        public ArrayList<Lecture> getAllMyLecture(int studentId) throws Exception {
            
            Connection conn = null;
            PreparedStatement ps = null;
            ResultSet rs = null;
            
            ArrayList<Lecture> list = new ArrayList<>();
            
            try {
                conn = getConnection();
                
                
                if(studentIdExist(studentId, conn)){
                    if(learningIdExist(studentId, conn)) {
                        conn = getConnection();
                        String query = "SELECT lecture.lecture_id AS id, lecture.name AS name, lecture.subject AS subject, lecture.likes AS likes, lecture.price AS price" +
                                " FROM learning, lecture" +
                                " WHERE learning.lecture_id = lecture.lecture_id AND learning.student_id = ?";
                        ps = conn.prepareStatement(query);
                        ps.setInt(1, studentId);
                        
                        rs = ps.executeQuery();
                        
                        while(rs.next()) {
                            list.add(new Lecture(
                                    rs.getInt("id"),
                                    rs.getString("name"), 
                                    rs.getString("subject"), 
                                    rs.getInt("likes"), 
                                    rs.getString("price")));
                        }
                    }
                }else{
                    throw new IdNotFoundException("์กด์žฌํ•˜๋Š” student id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                }
                
                
            }finally {
                closeAll(rs, ps, conn);
            }
            
            return list;
        }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

    ์ตœ์†กํฌ

    ์ตœ์†กํฌ

(10) ์ˆ˜๊ฐ• ์‹ ์ฒญ

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
        public void applyLecture(int studentId, Lecture lecture) throws Exception  {
            Connection conn = null;
            PreparedStatement ps = null;
            System.out.println("ํ•™์ƒ์•„์ด๋”” "+studentId);
            try {
                conn = getConnection();
                if(studentIdExist(studentId, conn)) {
                    if(!learningIdExist(lecture.getId(), studentId, conn)) {
                        conn = getConnection();
                        String query = "INSERT INTO learning(student_id, lecture_id, flag) VALUES(?, ?, ?)";
                        ps = conn.prepareStatement(query);
                        ps.setInt(1, studentId);
                        ps.setInt(2, lecture.getId());
                        ps.setInt(3, 0);
                        
                        System.out.println(ps.executeUpdate()+"๊ฐœ ๊ฐ•์˜๊ฐ€ ์ง€์›๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
                    }else {
                        System.out.println("์ด๋ฏธ ์ˆ˜๊ฐ•์‹ ์ฒญํ•œ ์ด๋ ฅ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.");
                    }
                }else {
                    throw new IdNotFoundException("์กด์žฌํ•˜๋Š” student id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                }
                
            }finally {
                closeAll(ps, conn);
            }
            
            
        }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

    ์ตœ์†กํฌ

(11) ์ˆ˜๊ฐ• ์ฒ ํšŒ

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
        public void cancleLecture(int studentId, Lecture lecture) throws Exception {
            Connection conn = null;
            PreparedStatement ps = null;
            
            try {
                conn = getConnection();
                if(learningIdExist(lecture.getId(),studentId, conn)) {
                    conn = getConnection();
                    String query = "DELETE learning WHERE student_id = ? AND lecture_id = ?";
                    ps = conn.prepareStatement(query);
                    ps.setInt(1, studentId);
                    ps.setInt(2, lecture.getId());
                    
                    System.out.println(ps.executeUpdate()+"๊ฐœ ๊ฐ•์˜๊ฐ€ ์ทจ์†Œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
                    getAllMyLecture(studentId);
                    
                }else {
                    throw new IdNotFoundException("์กด์žฌํ•˜๋Š” student id๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.");
                }
                
            }finally {
                closeAll(ps, conn);
            }
            
        }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(12) ๊ฐ•์˜์ž ์ถ”๊ฐ€

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    	public void addTeacher(Teacher teacher) throws Exception {
    		Connection conn = null;
            PreparedStatement ps = null;
            try {
                conn = getConnection();
                if(!teacherIdExist(teacher.getId(), conn)) { //๋“ฑ๋กํ•˜๋ ค๋Š” ๊ฐ•์˜์ž๊ฐ€ ์•„์ง ์—†์œผ๋ฉด
                    String query = "INSERT INTO teacher(teacher_id, name, email, subject) VALUES(seq_teacher.nextVal,?,?,?)";
                    ps=  conn.prepareStatement(query);
                    ps.setString(1, teacher.getName());
                    ps.setString(2, teacher.getEmail());
                    ps.setString(3, teacher.getSubject());
                    System.out.println(ps.executeUpdate()+" ๋ช… INSERT ์„ฑ๊ณต...addTeacher()..");
                }else {
                    throw new AlreadyExistException();
                }
            }finally {
                closeAll(ps, conn);
            }
    	}
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(13) ๊ฐ•์˜์ž ์ •๋ณด ์ˆ˜์ •

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    	public void updateTeacher(Teacher teacher) throws Exception {
    		Connection conn = null;
            PreparedStatement ps = null;
            try {
                conn = getConnection();
                String query = "UPDATE teacher SET name=?, email=?, subject=? WHERE teacher_id=?";
                ps = conn.prepareStatement(query);
                ps.setString(1, teacher.getName());
                ps.setString(2, teacher.getEmail());
                ps.setString(3, teacher.getSubject());
                ps.setInt(4, teacher.getId());
    
                int row = ps.executeUpdate();
                if(row==1)System.out.println(row+" ๋ช… UPDATE OK...updateTeacher()...");
                else throw new IdNotFoundException("์ˆ˜์ •ํ•  ๊ฐ•์˜์ž๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค");
            }finally {
                closeAll(ps, conn);
            }
    	}
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(14) ๊ฐ•์˜์ž ์ •๋ณด ์‚ญ์ œ

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    	public void deleteTeacher(int teacherId) throws Exception {
    		Connection conn = null;
            PreparedStatement ps = null;
            try {
                conn = getConnection();
                if(teacherIdExist(teacherId, conn)) { //ํ•ด๋‹น ๊ฐ•์˜์ž ์กด์žฌํ•˜๋ฉด ์‚ญ์ œ
                    String query = "DELETE teacher WHERE teacher_id=?";
                    ps = conn.prepareStatement(query);
                    ps.setInt(1, teacherId);
    
                    System.out.println(ps.executeUpdate()+" ๋ช… DELETE OK...deleteTeacher()..");
                }else {
                    throw new IdNotFoundException("์‚ญ์ œํ•  ๊ฐ•์˜์ž๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค ");
                }
            }finally {
                closeAll(ps, conn);
            }
    	}
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(15) ์ถ”์ฒœ์ˆ˜ ์ฆ๊ฐ€

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    public boolean likePossible(int studentId, int lectureId) throws Exception {
    	//๊ฐ•์˜-ํ•™์ƒ -> learning
    	//๋งŒ์•ฝ learning์˜ flag ๊ฐ’์ด 0์ด๋ฉด -> ์ข‹์•„์š” ๋ˆ„๋ฅด๊ธฐ ๊ฐ€๋Šฅ, true ๋ฆฌํ„ด
    	//๋งŒ์•ฝ learning์˜ flag ๊ฐ’์ด 1์ด๋ฉด -> ์ข‹์•„์š” ๋ˆ„๋ฅด๊ธฐ ๋ถˆ๊ฐ€๋Šฅ, false ๋ฆฌํ„ด
    	boolean flag = false;
    	
    	Connection conn = null;
          PreparedStatement ps = null;
          ResultSet rs = null;
          try {
          	conn = getConnection();
          	String query = "SELECT flag FROM learning WHERE student_id=? and lecture_id=?";
          	ps = conn.prepareStatement(query);
          	ps.setInt(1, studentId);
          	ps.setInt(2, lectureId);
          	rs = ps.executeQuery();
          	if(rs.next()) {
          		if(rs.getInt("flag")==0)
          			flag = true;
          	}
          } finally {
          	closeAll(rs, ps, conn);
          }
    	
    	return flag;
    }
    // ์ˆ˜๊ฐ•์ž๊ฐ€ ๊ฐ•์˜ ์ข‹์•„์š” ๊ฐ€๋Šฅ ์—ฌ๋ถ€ ํ™•์ธ
    // throw IdNotFoundException( ์ˆ˜๊ฐ•์ž id๋ž‘ ๊ฐ•์˜ id ๋‘˜๋‹ค ํ™•์ธ)
    
    private void setFlag(int studentId, int lectureId) throws Exception {
    	//learning ํ…Œ์ด๋ธ”์˜ flag 0->1
    	Connection conn = null;
    	PreparedStatement ps = null;
    	try {
    		conn = getConnection();
    	    String query = "UPDATE learning SET flag=? WHERE student_id=? and lecture_id=?";
    	    ps = conn.prepareStatement(query);
    	    ps.setInt(1, 1);
    	    ps.setInt(2, studentId);
    	    ps.setInt(3, lectureId);
    
    	    int row = ps.executeUpdate();
    	    if(row==1)System.out.println("flag ๋ณ€๊ฒฝ ์„ฑ๊ณต");
    	    else throw new IdNotFoundException("flag ๋ณ€๊ฒฝํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค");
       }finally {
    	   closeAll(ps, conn);
    	   }
    }
    
    //ํŠน์ • ๊ฐ•์˜์˜ ์ธ๊ธฐ๋„ ๊ฐ€์ ธ์˜ค๊ธฐ
    public int getLikes(int lectureId) throws Exception {
    	Connection conn = null;
          PreparedStatement ps = null;
          ResultSet rs = null;
          int likes = 0;
          try {
          	conn = getConnection();
              if(lectureIdExist(lectureId, conn)) { //๊ฐ•์˜ ์กด์žฌํ•˜๋ฉด ์ธ๊ธฐ๋„ ๊ฐ€์ ธ์˜ค๊ธฐ
              	String query = "SELECT likes FROM lecture WHERE lecture_id=?";
              	ps = conn.prepareStatement(query);
              	ps.setInt(1, lectureId);
              	rs = ps.executeQuery();
              	if(rs.next()) {
              		likes = rs.getInt("likes");
              	}
              }else {
                  throw new IdNotFoundException("์ธ๊ธฐ๋„๋ฅผ ๊ฐ€์ ธ์˜ฌ ๊ฐ•์˜๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค ");
              }
          } finally {
          	closeAll(rs, ps, conn);
          }
    	return likes;
    }
    
    @Override
    public void likeLecture(int studentId, int lectureId) throws Exception {
    	
    	if(!likePossible(studentId, lectureId))
    		return; //์ข‹์•„์š” ๋ˆ„๋ฅด๊ธฐ ๋ถˆ๊ฐ€๋Šฅํ•˜๋ฉด ๋
    	
    	int nowLikes = getLikes(lectureId);
    	//ํ˜„์žฌ ์ธ๊ธฐ๋„+1 -> db์— ์—…๋ฐ์ดํŠธ
    	Connection conn = null;
          PreparedStatement ps = null;
          try {
              conn = getConnection();
              String query = "UPDATE lecture SET likes=? WHERE lecture_id=?";
              ps = conn.prepareStatement(query);
              ps.setInt(1, nowLikes+1);
              ps.setInt(2, lectureId);
    
              int row = ps.executeUpdate();
              if(row==1)System.out.println("์ธ๊ธฐ๋„ ์˜ฌ๋ฆฌ๊ธฐ ์„ฑ๊ณต");
              else throw new IdNotFoundException("์ธ๊ธฐ๋„ ์˜ฌ๋ฆด ๊ฐ•์˜๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค");
          }finally {
              closeAll(ps, conn);
          }
          
          //flag 0->1๋กœ
          setFlag(studentId, lectureId);
    }
  • ๊ฒฐ๊ณผ

    ์ตœ์†กํฌ

(16) ํŠน์ • ๊ฐ•์˜ ๊ณผ๋ชฉ ํ• ์ธ๊ฐ€

  • ์†Œ์Šค์ฝ”๋“œ

    @Override
    public int discountLecture(String subject, int discount) throws Exception {
    	//ํŠน์ • subject์˜ ๊ฐ€๊ฒฉ ์ด ํ•ฉ์— ํ• ์ธ์œจ์„ ์ ์šฉํ•˜์—ฌ ํŒจํ‚ค์ง€ ๊ฐ€๊ฒฉ์„ ์•Œ๋ ค์ค€๋‹ค.
    	//SELECT SUM(price) FROM lecture WHERE subject='์ˆ˜ํ•™';
    	Connection conn = null;
          PreparedStatement ps = null;
          ResultSet rs = null;
          int total = 0;
          try {
          	conn = getConnection();
              String query = "SELECT SUM(price) FROM lecture WHERE subject=?";
              ps = conn.prepareStatement(query);
              ps.setString(1, subject);
              rs = ps.executeQuery();
              if(rs.next()) {
              	total = rs.getInt("SUM(price)");
              }
          } finally {
          	closeAll(rs, ps, conn);
          }
    	return total/discount;
    }
  • ๊ฒฐ๊ณผ

์ตœ์†กํฌ

11. ๋ฏธ๋‹ˆ ํ”„๋กœ์ ํŠธ ์ œ์ž‘ ํ›„๊ธฐ

  • ๊น€๊ฐ€๋นˆ

    • ์ถ”ํ›„ ๋””๋ฒจ๋กญ ํ•˜๊ณ  ์‹ถ์€ ๋‚ด์šฉ

      : ๋ณ„์  ์™ธ์— ์ˆ˜๊ฐ• ํ›„๊ธฐ๋ฅผ ๋‚จ๊ธธ ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ๊ณผ Q&A ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•ด๋ณด๊ณ  ์‹ถ๋‹ค.

    • ํ”„๋กœ์ ํŠธ์—์„œ ์ข‹์•˜๋˜ ์ 

      : ํ•ต์‹ฌ ๊ธฐ๋Šฅ์„ ์„ ๋ณ„ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ์ž์˜ ์ž…์žฅ์—์„œ ์‹œ์Šคํ…œ์„ ๋ฐ”๋ผ๋ณด๊ณ  ๊ธฐ๋Šฅ๋“ค์„ ์ถ”์ถœํ•œ ์ ์ด ์ข‹์•˜๋‹ค.

      ๋”๋ถˆ์–ด ๊ณ ์‹ฌํ•˜๋Š” ๊ณผ์ • ์†์—์„œ ์˜จ๋ผ์ธ ๊ต์œก ํ”Œ๋žซํผ์˜ ์ฒด๊ณ„๋ฅผ ์ดํ•ดํ•  ์ˆ˜ ์žˆ์–ด ์ข‹์•˜๊ณ ,

      ํ…Œ์ด๋ธ”๋“ค์€ ์ผ๊ด€์„ฑ์„ ์ง€ํ‚ค๊ณ  ํด๋ž˜์Šค๋Š” ์žฌ ์‚ฌ์šฉ์„ฑ์„ ๋†’์ด๊ธฐ ์œ„ํ•ด ์ƒ์† ๊ด€๊ณ„์ธ ํด๋ž˜์Šค๋“ค์„ ํ•œ ํ…Œ์ด๋ธ”๋กœ ๊ตฌ์„ฑํ•˜์ง€ ์•Š์•„๋„ ๋˜๋Š” ๊ฒƒ์„ ์ƒˆ๋กญ๊ฒŒ ๋ฐฐ์šธ ์ˆ˜ ์žˆ์–ด ์ข‹์•˜๋‹ค.

  • ๋งน์˜์šฑ

    • ์•„์‰ฌ์› ๋˜ ์ 

      :

    • ์ถ”ํ›„ ๋””๋ฒจ๋กญ ํ•˜๊ณ  ์‹ถ์€ ๋‚ด์šฉ

      :

    • ํ”„๋กœ์ ํŠธ์—์„œ ์ข‹์•˜๋˜ ์ 

      :

  • ์ตœ์†กํฌ

    • ์•„์‰ฌ์› ๋˜ ์ 

      : ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ๊ด€๊ณ„ ์„ค์ •์—์„œ ์กฐ๊ธˆ์ด๋ผ๋„ ๋ณต์žกํ•ด์ง€๋ฉด ์˜ณ๊ฒŒ ์„ค๊ณ„ํ•˜๊ณ  ์žˆ๋Š” ๊ฒƒ์ธ์ง€ ํ—ท๊ฐˆ๋ฆฌ๋Š” ์ƒํ™ฉ์ด ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ด ๋ถ€๋ถ„์—์„œ ๋” ๋Šฅ์ˆ™ํ•˜๊ฒŒ ์„ค๊ณ„๋ถ€๋ถ„์„ ์™„์„ฑํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค๋ฉด ๊ธฐ๋Šฅ์€ ๋‹ค์–‘ํ™”ํ•  ์ˆ˜ ์žˆ์—ˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์„ค๊ณ„์—์„œ ๋งŽ์€ ์•„์ด๋””์–ด๋ฅผ ์ฐฝ์ถœํ•˜๊ธฐ ์–ด๋ ค์› ์ง€๋งŒ ์ข‹์€ ๊ฒฝํ—˜์ด์—ˆ์Šต๋‹ˆ๋‹ค. ์œ ์Šค์ผ€์ด์Šค ๋‹ค์ด์–ด๊ทธ๋žจ ๊ธฐ๋Šฅ์„ ์•กํ„ฐ ์ค‘์‹ฌ์œผ๋กœ ์ž‘์„ฑํ–ˆ๋˜ ๊ฒƒ์ด ์ฒ˜์Œ์— ํฐ ์˜ค๋ฅ˜์˜€์ง€๋งŒ ์ด๋ฒˆ ๊ฒฝํ—˜์„ ๊ณ„๊ธฐ๋กœ ์ •ํ™•ํ•˜๊ฒŒ ์„ค๊ณ„ ๋Šฅ๋ ฅ์„ ํ–ฅ์ƒ์‹œ์ผฐ์Šต๋‹ˆ๋‹ค.

    • ์ถ”ํ›„ ๋””๋ฒจ๋กญ ํ•˜๊ณ  ์‹ถ์€ ๋‚ด์šฉ

      : ๋Œ“๊ธ€ ์ž‘์„ฑ/์‚ญ์ œ/์ˆ˜์ •/๋Œ€๋Œ“๊ธ€๊ณผ ์ธ๊ณต์ง€๋Šฅ์„ ํ™œ์šฉํ•œ ํ‚ค์›Œ๋“œ ๋ถ„์„์„ ํ†ตํ•ด ํ•™์ƒ๋“ค์˜ ์ฃผ์š” ๊ด€์‹ฌ ๊ฐ•์˜ ๋ชฉ๋ก์„ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๋‚ด์šฉ๋„ ๋„ฃ๊ณ ์‹ถ์Šต๋‹ˆ๋‹ค. ๊ฐ•์˜ ์ˆ˜๊ฐ•์— ํ•„์ˆ˜์ ์ธ ๊ฐ•์˜ ์„ค๋ช…๋ž€๊ณผ ๊ฐ•์˜ ์ˆ˜๊ฐ• ํ›„๊ธฐ ๋ชฉ๋ก ๋ฆฌ์ŠคํŠธํ™”๋กœ ์‹ค์ œ ์„œ๋น„์Šค์— ๊ฐ€๊น๊ฒŒ ๊ตฌํ˜„ํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

    • ํ”„๋กœ์ ํŠธ์—์„œ ์ข‹์•˜๋˜ ์ 

      : ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ๋ฅผ ํ†ตํ•˜์—ฌ VO, DAO ์ธํ„ฐํŽ˜์ด์Šค, DAO ๊ตฌํ˜„ ํด๋ž˜์Šค์™€ ํ…Œ์ŠคํŠธ ํด๋ž˜์Šค ๊ตฌํ˜„ ๋Šฅ๋ ฅ์„ ํ–ฅ์ƒ์‹œ์ผฐ์Šต๋‹ˆ๋‹ค. DAO ๊ตฌํ˜„์ฒด ๋ฉ”์„œ๋“œ๋Š” ํ•ด๋‹น ์„œ๋น„์Šค์— ๋Œ€ํ•ด ์ผ๋Œ€์ผ๋กœ ํ˜ธ์ถœ๋œ๋‹ค๋Š” ์ ์„ ์ฝ”๋“œ ๊ตฌํ˜„์„ ๊ตฌ์ฒด์ ์œผ๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด ์„œ๋น„์Šค์˜ ๋™์ž‘์›๋ฆฌ์— ๋Œ€ํ•œ ํ๋ฆ„์„ ์ฒด๋“ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ์˜ค๋ผํด์„ ํ™œ์šฉํ•œ JDBC์˜ ๋ณต์žกํ•œ ์ฟผ๋ฆฌ๋ฌธ ์ž‘์„ฑ๋Šฅ๋ ฅ์„ ๊ตฌ์ฒดํ™”ํ•˜์—ฌ ๊ต์œก ์„œ๋น„์Šค ํ”Œ๋žซํผ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ณด๋‹ค ๋” ๋ณต์žกํ•œ ์„œ๋น„์Šค ๊ตฌํ˜„์—๋„ ํฐ ์–ด๋ ค์›€ ์—†์ด ์ œ์ž‘ํ•ด๋‚˜๊ฐˆ ๊ฒƒ์ด๋ผ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

โ†’ ์ž˜๋œ ์ 

: DAO ๊ตฌํ˜„์ฒด ๋ฉ”์„œ๋“œ๋Š” ํ•ด๋‹น ์„œ๋น„์Šค์— ๋Œ€ํ•ด ์ผ๋Œ€์ผ๋กœ ํ˜ธ์ถœ๋œ๋‹ค๋Š” ์ ์„ ์ฝ”๋“œ ๊ตฌํ˜„์„ ๊ตฌ์ฒด์ ์œผ๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด ์„œ๋น„์Šค์˜ ๋™์ž‘ ์›๋ฆฌ์— ๋Œ€ํ•œ ํ๋ฆ„์„ ์ฒด๋“ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

ํ•ต์‹ฌ ๊ธฐ๋Šฅ์„ ์„ ๋ณ„ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ์ž์˜ ์ž…์žฅ์—์„œ ์‹œ์Šคํ…œ์„ ๋ฐ”๋ผ๋ณด๊ณ  ๊ธฐ๋Šฅ๋“ค์„ ์ถ”์ถœํ•œ ์ ์ด ์ข‹์•˜์Šต๋‹ˆ๋‹ค.

ํ…Œ์ด๋ธ”๋“ค์€ ์ผ๊ด€์„ฑ์„ ์ง€ํ‚ค๊ณ  ํด๋ž˜์Šค๋Š” ์žฌ ์‚ฌ์šฉ์„ฑ์„ ๋†’์ด๊ธฐ ์œ„ํ•ด ์ƒ์† ๊ด€๊ณ„์ธ ํด๋ž˜์Šค๋“ค์„ ํ•œ ํ…Œ์ด๋ธ”๋กœ ๊ตฌ์„ฑํ•˜์ง€ ์•Š์•„๋„ ๋˜์—ˆ๋˜ ์ ์ด ์ž˜ ํ–ˆ๋˜ ๊ฒƒ ๊ฐ™๋‹ค.

โ†’ ์•„์‰ฌ์šด ์ 

: ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ๊ด€๊ณ„ ์„ค์ •์—์„œ ์กฐ๊ธˆ์ด๋ผ๋„ ๋ณต์žกํ•ด์ง€๋ฉด ์˜ณ๊ฒŒ ์„ค๊ณ„ํ•˜๊ณ  ์žˆ๋Š” ๊ฒƒ์ธ์ง€ ํ—ท๊ฐˆ๋ฆฌ๋Š” ์ƒํ™ฉ์ด ์žˆ์—ˆ๋Š”๋ฐ ๋” ๋Šฅ์ˆ™ํ•˜๊ฒŒ ์„ค๊ณ„ํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค๋ฉด ๋‹ค์–‘ํ™”ํ•  ์ˆ˜ ์žˆ์—ˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์œ ์Šค์ผ€์ด์Šค ๋‹ค์ด์–ด๊ทธ๋žจ ๊ธฐ๋Šฅ์„ ์•กํ„ฐ ์ค‘์‹ฌ์œผ๋กœ ์ž‘์„ฑํ–ˆ๋˜ ๊ฒƒ์ด ์ฒ˜์Œ์— ํฐ ์˜ค๋ฅ˜์˜€๋˜๊ฒƒ์ด ์•„์‰ฌ์›€์ด ๋‚จ์Šต๋‹ˆ๋‹ค.

๋˜ ๊ฐœ์ธ์˜ ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋ฅผ ์กฐ๊ธˆ ๋” ์„ธ์‹ฌํ•˜๊ฒŒ ์‚ดํ”ผ๋ฉด์„œ ์ž‘์„ฑํ–ˆ๋‹ค๋ฉด ์‹œ๊ฐ„์„ ๋‹จ์ถ• ์‹œํ‚ฌ ์ˆ˜ ์žˆ๊ณ  ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ๋ฅผ ์›ํ• ํ•˜๊ฒŒ ์ง„ํ–‰ํ•  ์ˆ˜ ์žˆ์—ˆ์„ํ…๋ฐ ๊ทธ๋Ÿฌ์ง€ ๋ชปํ•œ ์ ์ด ์•„์‰ฝ๋‹ค. ์ถ”ํ›„์—๋Š” ๊ฐœ์ธ ์ž‘์—… ์ง„ํ–‰์„ ์กฐ๊ธˆ ๋” ์„ธ์‹ฌํ•˜๊ฒŒ ์‚ดํŽด์•ผ ํ•จ์„ ๊นจ๋‹ฌ์•˜๋‹ค.

12. ํ”„๋กœ์ ํŠธ ๋‹น์‹œ ๊ณ ๋ฏผํ–ˆ๋˜ ๋ถ€๋ถ„

1. to_Char์ด์šฉํ•ด์„œ ์„ธ์ž๋ฆฌ ์ˆ˜ , ๋ฅผ ๋„ฃ์–ด์„œ ํ‘œํ˜„ํ•  ๋•Œ Lecture DAO์˜ ํ•„๋“œ price์˜ ๋ฐ์ดํ„ฐ ํƒ€์ž…
- to_char๋กœ ํ‘œํ˜„ํ•œ ๊ฐ’์„ String์œผ๋กœ ์ฝ์–ด์™”๊ธฐ์— price ํ•„๋“œ์˜ ๋ฐ์ดํ„ฐ ํƒ€์ž…์„ String์œผ๋กœ ๋ณ€๊ฒฝํ–ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์‹ค์ œ ํ…Œ์ด๋ธ”์—์„œ price์˜ ๋ฐ์ดํ„ฐ ํƒ€์ž…์€ NUMBER๋กœ ์ง€์ •ํ–ˆ๊ธฐ์— vo์—์„œ๋„ int๋กœ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค. ์ด๋ฅผ ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌํ• ์ง€ ๊ณ ๋ฏผ ์ค‘์ด๋‹ค.

2. Eclipse์™€ Oracle DB์—์„œ ๋ฐ์ดํ„ฐ ํƒ€์ž…์˜ ์ฐจ์ด
- Number vs Integer= int
: ์ดํด๋ฆฝ์Šค์˜ eXERD๋ฅผ ์ด์šฉํ•˜์—ฌ DB ๋ชจ๋ธ๋ง์„ ์ž‘์„ฑํ•˜๋ฉด ์ •์ˆ˜์˜ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด integer๋กœ ์žกํžŒ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์‹ค์ œ ์šฐ๋ฆฌ๊ฐ€ ์‚ฌ์šฉํ•  ์˜ค๋ผํด DB์—์„œ๋Š” integer๋ฅผ ์ž˜ ์‚ฌ์šฉํ•˜์ง€ ์•Š์œผ๋ฉฐ, ์‚ฌ์šฉ ์‹œ ์ž์ฒด์ ์œผ๋กœ NUMBER ํƒ€์ž…์œผ๋กœ ๋ณ€ํ™˜ํ•œ๋‹ค. ๋”ฐ๋ผ์„œ ํšŒ์˜ ํ›„, DB ๋ชจ๋ธ๋ง ์ž‘์„ฑ ์‹œ ์ •์ˆ˜ํ˜• ๋ฐ์ดํ„ฐ ํƒ€์ž…์€ NUMBER๋กœ ํ†ต์ผํ–ˆ๋‹ค.

About

๐Ÿคน์ž๋ฐ” JDBC์™€ ์˜ค๋ผํด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ๋ฏธ๋‹ˆ ํ”„๋กœ์ ํŠธ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published