Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

fisa-01

์šฐ๋ฆฌfisa ํŒ€ ํ”„๋กœ์ ํŠธ

  • ์šฐ๋ฆฌ ์ƒํ’ˆ์˜ ํŠน์ง•!! ๋ฌด๊ถ๋ฌด์ง„ํ•œ ํ™•์žฅ์„ฑ๊ณผ ์ •ํ™•ํ•œ ๋ฐ์ดํ„ฐ ํ‘œํ˜„!
  1. ๋ฐ์ดํ„ฐ ํ…Œ์ด๋ธ” ๊ด€๋ฆฌ
  2. ํšŒ์›๊ฐ€์ž…์‹œ ๋ˆ์„์ž…๋ ฅ๋ฐ›์•„์„œ 500์› ๋ฏธ๋งŒ์ผ ๊ฒฝ์šฐ ์‹ค๋ฒ„, 500์› ์ด์ƒ์ผ ๊ฒฝ์šฐ ๊ณจ๋“œ, ๋‹ค์ด์•„๋ชฌ๋“œ
  3. ์ด๋ฆ„์€ 3๊ธ€์ž์ดํ•˜

=๋ชฉํ‘œ ๊ธฐ๋Šฅ=

  1. ํšŒ์›๊ฐ€์ž…
  2. ๋กœ๊ทธ์ธ "๋ˆ„๊ตฌ๋ˆ„๊ตฌ๋‹˜์ด ๋กœ๊ทธ์ธ ํ•˜์…จ์Šต๋‹ˆ๋‹ค. ์ž”์•ก์€ ์–ผ๋งˆ์ž…๋‹ˆ๋‹ค, ๊ทธ๋ฆฌ๊ณ  ๋“ฑ๊ธ‰์€ ๋ฌด์—‡์ž…๋‹ˆ๋‹ค."

Controller ๊ธฐ๋Šฅ:

  1. showAllCustomer
  • ๋ชจ๋“  ํšŒ์›๋ฒˆํ˜ธ, ์ด๋ฆ„, ์ž”์•ก, ๋“ฑ๊ธ‰๋ฒˆํ˜ธ ์ถœ๋ ฅ
  1. login:
  • ์•„์ด๋””๋ฅผ ์ž…๋ ฅ๋ฐ›์•„์„œ ์ด๋ฆ„๊ณผ, ์ž”์•ก, ๋“ฑ๊ธ‰ ์ถœ๋ ฅ
  1. signin
  • ์ด๋ฆ„๊ณผ ๋ˆ์„ ์ž…๋ ฅ๋ฐ›์•„ ํšŒ์› ์ถ”๊ฐ€
  • ํšŒ์›๋ฒˆํ˜ธ, ์ด๋ฆ„๊ณผ ๋ˆ์„ ์ž…๋ ฅ๋ฐ›์•„ ํšŒ์› ์ถ”๊ฐ€

EndView ๊ธฐ๋Šฅ:

  1. lineCounter
  • ํ–‰ ๋ฒˆํ˜ธ ์ถœ๋ ฅ

MyUtil ๊ธฐ๋Šฅ:

  1. strMapping
  • char๋ฐฐ์—ด ๋ฐ›์•„์„œ ๋ฌธ์ž์—ด ๋ฐ˜ํ™˜
  • ๋ฌธ์ž์—ด ๋ฐ›์•„์„œ char๋ฐฐ์—ด ๋ฐ˜ํ™˜
  1. strInteger
  • ๋ž˜ํผํด๋ž˜์Šค ๋ฐ›์•„์„œ ๋„์ธ๊ฒฝ์šฐ ๋ฌธ์ž์—ด "null"๋ฐ˜ํ™˜

=์ž‘์—… ๋‚ด์—ญ=

-9์‹œํƒ€์ž„-

  1. ํšŒ์˜๋ฅผ ํ†ตํ•œ ๋ช…์„ธ์„œ ์ž‘์„ฑ
  2. ๋ฐ์ดํ„ฐ ํ…Œ์ด๋ธ” ์„ค๊ณ„
  3. mysql์„ dbeaver๋ฅผ ์‚ฌ์šฉํ•ด์„œ projectA๋ผ๋Š” ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค๋ฅผ ์ƒ์„ฑ
  4. ๋ฐ์ดํ„ฐ ํ…Œ์ด๋ธ” ์ƒ์„ฑ
  5. ์ œ์•ฝ์กฐ๊ฑด ์„ค์ •/ํ™•์ธ
  6. ์ž‘์—… ๊ฒ€์ˆ˜

-10์‹œํƒ€์ž„-

  1. ๋ฉค๋ฒ„์‹ญ ํ…Œ์ด๋ธ” ๋ ˆ์ฝ”๋“œ ์ž…๋ ฅ (3๊ฐœ)
  2. ์ปค์Šคํ„ฐ๋จธ ํ…Œ์ด๋ธ” ๋ ˆ์ฝ”๋“œ ์ž…๋ ฅ (3๋ช…)
  3. ์ž๋ฐ” ํ”„๋กœ์ ํŠธ ์…‹ํŒ… (๋ฉ”์ด๋ธ: mysql์ปค๋‚ตํ„ฐ, lombok)
  4. ์ž๋ฐ” ํ”„๋กœ์ ํŠธ ์‹œ์ž‘์„ ์œ„ํ•ด StartView Main์—์„œ db์— ์ ‘์†ํ•˜๊ณ , ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒ/์ถœ๋ ฅํ•˜๋Š” ๋ถ€๋ถ„๊นŒ์ง€ ์™„๋ฃŒ

-11์‹œํƒ€์ž„-

  1. StartView Main์— ๋งŒ๋“ค์–ด๋‘” ๋กœ์ง์„ ํ™œ์šฉํ•˜๊ธฐ์œ„ํ•ด ๋ถ„ํ• 

-12์‹œํƒ€์ž„-

  1. ๋กœ์ง ๋ถ„ํ• ํ•ด์„œ jdbc์— ์—ฐ๊ฒฐ๋˜๋Š” ๋ถ€๋ถ„๊นŒ์ง€ ์™„๋ฃŒ/ํ™•์ธ

-1์‹œํƒ€์ž„-

  1. ์ ์‹ฌ์‹œ๊ฐ„

-2์‹œํƒ€์ž„-

  1. ๋ผ์ธ์นด์šดํ„ฐ ๊ธฐ๋Šฅ ์ถ”๊ฐ€ (์ถœ๋ ฅ ํ–‰์„ ํ‘œ์‹œํ•ด ์ค๋‹ˆ๋‹ค.)
  2. ์ž‘์—…๋„์ค‘ resultSet์—์„œ next๋ฅผ ์•ˆํ•ด์ฃผ๋Š” ์˜ค๋ฅ˜๋ฅผ ๋ฒ”ํ–ˆ๊ณ , "์œ XX"๋‹˜์ด ๋ฌธ์ œ๋ฅผ ์ฐพ์•„ ํ•ด๊ฒฐํ•ด์ฃผ์…จ์Šต๋‹ˆ๋‹ค
  3. showCustomer์™€ showAllCustomer ๊ธฐ๋Šฅ ์™„์„ฑ

-3์‹œํƒ€์ž„-

  1. ๋กœ๊ทธ์ธ ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ
  2. ๋ฉค๋ฒ„์‰ฝ ์กฐํšŒ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ
  3. ํšŒ์›๊ฐ€์ž… ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ์ค‘ executeQuery๋ฌธ์„ ์‚ฌ์šฉํ•ด์„œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒ, executeUpdate๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด๊ฒฐ (์ตœXX ๋‹˜์ด ํ•ด๊ฒฐ)
  4. ํšŒ์›๊ฐ€์ž… ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ ์™„๋ฃŒ

-4์‹œํƒ€์ž„-

  1. ํšŒ์›๊ฐ€์ž… ์˜ˆ์™ธ์ฒ˜๋ฆฌ ๊ฐ•ํ™”
  2. rs

-5์‹œํƒ€์ž„-

  1. ์ฝ”๋“œ ํ™•์ธ
  2. ์˜ค๋ฅ˜ ์ˆ˜์ • Controller 33๋ฒˆ ์ค„์— c==null ์ถ”๊ฐ€ Model 80~84๋ฒˆ ์ค„ MyUtil ์‚ญ์ œ ํ›„ ๋ฐ์ดํ„ฐ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ

SQL ๋ช…๋ น์–ด

create database project_w;

use project_w;

create table customer(
	cno int not null,
	cname varchar(3),
	cmoney int,
	cpw varchar(3),
	mno int,
	constraint pk_cno primary key (cno)
)

desc customer;

drop table membership;

create table membership(
	mno int not null,
	mname varchar(10),
	constraint pk_mno primary key (mno)
)

desc membership;

alter table customer 
add constraint fk_cus_mem foreign key (mno) references membership (mno)
on delete no action on update no action;

select * from information_schema.table_constraints where TABLE_NAME='customer';

insert into membership values(10, "silver");
insert into membership values(20, "gold");
insert into membership values(30, "diamond");

insert into customer values(101, "NOA", 100, "123", 10);
insert into customer values(102, "MOA", 300, "456", 20);
insert into customer values(103, "KAL", 600, "789", null);

select * from customer;
select * from membership;

update 

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages