2018. 5. 27. 00:06 개발

코드로 spring

create table tbl_member (

userid varchar(50) not null,

userpw varchar(50) not null,

username varchar(50) not null,

email varchar(100),

regdate timestamp default now(),

updatedate timestamp default now(),

primary key(userid)

);



create table tbl_board (

bno INT NOT NULL AUTO_INCREMENT,

title VARCHAR(200) NOT NULL,

content TEXT NULL,

writer VARCHAR(50) NOT NULL,

regdate TIMESTAMP NOT NULL DEFAULT now(),

viewcnt INT DEFAULT 0,

PRIMARY KEY(bno));


XML파일의


CDATA 

XML 코드 중 XML parser에 의해 해석하지 말고 그대로 브라우저에 출력하라는 뜻..

"&",">","<" 과 같은 특수문자를 쓰고 싶은데

XML parser가 태그로 인식하는 것을 방지하기 위해서,

이 것(위의 ... 부분)은 태그가 아니고 그냥 String이다! 


create table tbl_reply (

rno int NOT NULL AUTO_INCREMENT,

bno int not null default 0,

replytext varchar(1000) not null,

replyer varchar(50) not null,

regdate TIMESTAMP NOT NULL default now(),

updatedate TIMESTAMP NOT NULL default now(),

primary key(rno)

);

alter table tbl_reply add constraint fk_board

foreign key (bno) references tbl_board (bno);


create table tbl_user(

uid varchar(50) not null,

upw varchar(50) not null,

uname varchar(100) not null,

upoint int not null default 0,

primary key(uid)

);


create table tbl_message (

mid int not null auto_increment,

    targetid varchar(50) not null,

    sender varchar(50) not null,

    message text not null,

    opendate timestamp,

    senddate timestamp not null default now(),

    primary key(mid)

);


alter table tbl_message add constraint fk_usertarget

foreign key (targetid) references tbl_user (uid);


alter table tbl_message add constraint fk_usersender

foreign key (targetid) references tbl_user (uid);


insert into tbl_user(uid, upw, uname) values ('user00', 'user00', 'IRON MAN');

insert into tbl_user(uid, upw, uname) values ('user01', 'user01', 'CAPTAIN');

insert into tbl_user(uid, upw, uname) values ('user02', 'user02', 'HULK');

insert into tbl_user(uid, upw, uname) values ('user03', 'user03', 'THOR');

insert into tbl_user(uid, upw, uname) values ('user10', 'user10', 'QUICK SILVER');

'개발' 카테고리의 다른 글

spring 시큐리티  (0) 2018.05.31
admin table  (0) 2018.05.25
여러값을 배열로 받아서 처리  (0) 2018.05.24
MemberDTO  (0) 2018.05.21
spring 파일 업로드  (0) 2018.05.21
Posted by 커다란꼬꼬마

블로그 이미지
커다란꼬꼬마

공지사항

Yesterday
Today
Total

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 올라온 글

최근에 달린 댓글

글 보관함