컴퓨터엔 서버가 있고 여러 IP address가 있는데
이것은 문 같은거다
ip address, port = TCP/IP
: 문을 연다
port에는 TCP, UDP라는 포트가 있다
서버 표준 번호=80
클라이언트는 80번 서버로 연결된다
톰캣은 서버번호가 8080
클라이언튼느 8080으로 연결된다
나머지 문은 다 닫혀잇다
mysql 포트번호 3306
-----------------
db에 mysql 들어가서
use mysql; 실행
-curd정의
-DDL
/*
use mysql;
create table tblboard (
b_num int not null primary key AUTO_INCREMENT,
b_subject varchar(100) not null,
b_contents varchar(2000) not null,
b_name varchar(50) not null,
b_date date not null default sysdate()
);
-- select * from tblboard;
INSERT INTO tblboard (b_subject, b_name, b_contents) VALUES ('제목이다','홍길동','jsp프로그래밍');
INSERT INTO tblboard (b_subject, b_name, b_contents) VALUES ('22','홍길222동','jsp프로222그래밍');
*/
주의 : mysql에서 sysdate는 일시만 나오고 시간은 안나오기 때문에 datetype을 datetime이나 datestamp로 해줘야 함
그런데 이미 데이터가 들어간 상태에서는 데이터타입 변경이 불가함
따라서, tbl을 drop 시키고 다시 생성시켜야 함
use mysql;
/*
create table tblboard (
b_num int not null primary key AUTO_INCREMENT,
b_subject varchar(100) not null,
b_contents varchar(2000) not null,
b_name varchar(50) not null,
b_date datetime not null default sysdate()
);
*/
select * from tblboard;
-- INSERT INTO tblboard (b_subject, b_name, b_contents) VALUES ('제목이다','홍길동','jsp프로그래밍');
-- INSERT INTO tblboard (b_subject, b_name, b_contents) VALUES ('22','홍길222동','jsp프로222그래밍');
-- drop table tblboard;
댓글