본문 바로가기

Web & Mobile102

Lecture 22 - Java(3) 배열 - Array : 같은 타입의 여러 변수를 하나의 묶음으로 다루는 것을 '배열(Array)'이라고 한다. 많은 양의 데이터를 변수로 선언하기 힘들기 때문에 배열을 사용하여 같은 변수로 된 데이터들을 손쉽게 다룰 수 있다. public class ArrayEx01 { public static void main(String[] args) { // 선언 int[] arr1; int arr2[]; // 생성 arr1 = new int[5]; // 초기화 arr1[0] = 10; arr1[1] = 20; arr1[2] = 30; arr1[3] = 40; arr1[4] = 50; System.out.println(arr1[0]); System.out.println(arr1[4]); } } public clas.. 2019. 4. 18.
Lecture 21 - Java(2) PrintEx01 print 하는 법 public class PrintEx01 { public static void main(String[] args) { // println : print + 엔터 System.out.println("print"); System.out.println("print"); System.out.print("print"); System.out.print("print"); System.out.println(""); // 형식화된 출력 System.out.printf("정수는 %d\n", 123); System.out.printf("%s는 %d", "실수", 456); } } println : print + 엔터 print는 한줄로 붙어서 나옴 println은 엔터가 붙어서 나오고 .. 2019. 4. 18.
Lecture 20 - Java(1) Windows Java 환경 구축 JAVA (Java Programming Language) OS의 역사 Unix 프로그램 언어 cobol c -> c++ (어렵다 / 라이브러리 없음(다 내가 만들어야함)) 주 사용망 : 공공기관, 은행망 => Java MS Windows Linux 2019. 4. 18.
Lecture 19 - PLSQL(3) set serveroutput ON begin tel1; end; / set serveroutput OFF stored procedure declare create or replace procedure 프로시저명 is 변수 선언 변수선언 begin begin end end / tel 1 프로시저 create or replace procedure tel1 is v_tel varchar2(10) := '123456'; begin v_tel := substr(v_tel, 1, 3) || '-' || substr(v_tel, 4); dbms_output.put_line('전화번호 : ' || v_tel); end; / tel_main serveroutput을 tel1에서처럼 직접 치지 말고 템플릿에 적어두어 t.. 2019. 4. 17.
Lecture 18 - PLSQL(2) plsql 20 table set serveroutput ON DECLARE --TABLE type table_type is table of number index by binary_integer; v_table table_type; BEGIN v_table(1) := 10; v_table(2) := 20; v_table(3) := 30; v_table(4) := 40; v_table(5) := 50; for idx in 1..5 loop dbms_output.put_line(v_table(idx)); end loop; end; / set serveroutput OFF plsql 21 암시적 커서(cursor) 1. 암시적 커서 - 오라클이 내부적으로 사용하는 커서 sql%rowcount - 영향받은 함.. 2019. 4. 17.
Lecture 17 - PLSQL(1) 오라클 PL/SQL 강좌 PL/SQL은 Oracle's Procedural Language extension to SQL의 약자이다. 종류 익명 프로시저 - file을 통해서 실행 내장 프로시저 - Oracle에 저장 함수 - 함수형식으로 Oracle에 저장 plsql 01 시작 set serveroutput ON begin -- 내용 구문 -- 출력 -- 한 줄 + 엔터 dbms_output.put_line('Hello PL/SQL'); dbms_output.put_line('Hello PL/SQL'); dbms_output.put('Hello PL/SQL'); dbms_output.put('Hello PL/SQL'); dbms_output.put_line(''); dbms_output.put('Hel.. 2019. 4. 17.
Lecture 16 - SQL(6) DDL(Data Definition Language) 테이블 - 뷰 - select문의 별명 시퀀스 - 고유번호 생성기 인덱스 - 목차 시노님 - 객체의 별칭 TCL(Transaction Control Language) * Transaction - lock / 읽기 일관성 - commit (all or nothing) - rollback - savepoint DCL(Data Control Language) * create user 사용자아이디 identified by 암호; - grant to - revoke from 권한 시스템 - 관리자 객체 - 소유자 truncate는 rollback이 안됨!! 속도는 truncate가 빠르나 rollback이 안되니 rollback이 필요한 자료일 경우 delet.. 2019. 4. 17.
Lecture 15 - SQL(5) ※Review DML insert update delete merge truncate 트랜잭션(Transaction) 접속사용자 테이블 - 1명 => 여러명이 동시에 한테이블에 접속할 경우도 있다. 테이블 - delete 사람 A -> update 사람 B - 업데이트 하려보니 자료가 사라짐.... => 한사람이 동작을 하고 있으면 다른 사람은 하지마!! 라는 개념으로 만들어 진게 트랜잭션(Transaction)이다. 처음 사용자가 LOCK을 걸고 다하면 LOCK을 푼다. 허나 이 기능은 DML 문만 가능하다. 클라이언트 서버 : 세션 - 아이디가 달라야 생기는 것은 아니다. 아이디가 같아도 접속 방법이 다르면 다른 세션이다. 서로 같은 아이디로 로그인 하였으나 왼쪽과 오른쪽 결과가 다르다 이것이 트랜잭.. 2019. 4. 15.