JSP [ SQL ]

양혜정·2024년 4월 27일
0

javascript_web

목록 보기
71/81

SQL

SYS 로 작업

  • 계정 생성
-- 오라클 계정 생성시 계정명 앞에 c## 붙이지 않고 생성하도록 하겠습니다.
alter session set "_ORACLE_SCRIPT"=true;
-- Session이(가) 변경되었습니다.

-- 오라클 계정명은 @ 이고 암호는 # 인 사용자 계정을 생성합니다.
create user @ identified by # default tablespace users; 
-- User @이(가) 생성되었습니다.
  • 생성한 계정에 권한 부여하기
grant connect, resource, create view, unlimited tablespace to @;
-- Grant을(를) 성공했습니다.

생성한 계정으로 작업

  • 테이블 생성
-- 예시
create table tbl_person_interest
(seq          number
,name         Nvarchar2(20) not null
,school       Nvarchar2(10) not null
,color        varchar2(10)  not null
,food         Nvarchar2(30) 
,registerday  date default sysdate not null 
,updateday    date 
,constraint PK_tbl_person_interest primary key(seq)
);
-- Table TBL_PERSON_INTEREST이(가) 생성되었습니다.
  • sequence 생성
-- 예시
create sequence person_seq
start with 1
increment by 1
nomaxvalue
nominvalue
nocycle;
-- Sequence PERSON_SEQ이(가) 생성되었습니다.

정리

  • JSPServlet -> webapp -> WEB-INF -> chap05 -> SQL -> chap05_oracle.sql

0개의 댓글

관련 채용 정보