저장 프로시저는.. 하나 이상의 sql문을 후에 사용하기 편하게 저장해둔 것. mysql 4.x 이하 버전에서는 프로시저를 지원하지 않는다. mysql 5.x 부터 지원.. 저장 프로시저를 사용하는 이유? - 복잡한 작업을 하나의 단위로 묶어 쉽게 사용하기 위해 - 같은 코드를 반복할 필요없이 프로시저를 만들어 놓고 재활용 하기 위해 - 테이블의 칼럼이름이나 로직 등이 변경 되었을 때 저장 프로시저만 변경하면 되므로 사용하는 입장에서는 신경을 쓸 필요가 없다 - 저장 프로시저는 컴파일된 형식으로 저장되기 때문에 DBMS가 명령을 수행하는 작업이 보다 적어지므로 성능의 향상을 기대해 볼 수 있다. 간단한 사용법(사용프로그램 토드 FOR MYSQL) 1 2 3 4 5 6 7 8 9 10CREATE PROCE..
- delegate는 함수(메서드)를 담을 수 있는 타입이다.- 타입이기 때문에 메서드의 매개변수나 리턴타입 같은 곳에도 delegate타입을 선언 할 수 있다.- 델리게이트에 메서드를 여러개 담을 수 있다. 다음은 델리게이트의 사용 예이다. 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 delegate void OperDelegate(int n1, int n2); class Oper { public void Add(int n1, int n2) { Console.WriteLine(n1 + n2); } public void Sub(int n1, int n2) { Console.WriteLine(n1 - n2); } publi..
연산자 오버로딩이란?- 피연산자가 하나 또는 둘 모두가 사용자 정의 클래스거나 구조체 형식일 때 해당 클래스나 구조체 안에 사용자 정의 연산자를 구현할 수 있는 것 예를 들어 코드를 보겠다.class Kilogram { int kg; public int Kg { get { return kg; } } public Kilogram(int kg) { this.kg = kg; } public int Add(Kilogram k) { return this.kg + k.kg; } public static Kilogram operator +(Kilogram k1, Kilogram k2){ return new Kilogram(k1.kg + k2.kg); } } class Program { static void Main(..
Object는 모든 클래스의 최상위 조상이다.c#도 모든 객체지향언어가 그렇듯 단일 상속만을 지원하는데..만약 클래스 A와 클래스 B가 있는데클래스 A는 부모클래스클래스 B는 자식클래스라 하자. c#컴파일러는 컴파일시 아무것도 상속 받고 있지 않는 클래스에 대해 System.Object클래스를 상속한다.클래스 B의 부모는 A클래스이지만 클래스 A의 부모는 아무것도 없기 때문에 결국 컴파일시 class A : Object{ }같이 변한다. 종국에는 상속관계도에 따라Object class - A class - B class와 같이되므로 A와 B 클래스 둘 전부 Object를 최고 조상 클래스로 갖게된다. Object클래스는 참조형식이지만 값형식이 되기도 한다.값형식일 경우는 System.ValueType을 ..
is 와 as 키워드와 비슷한 기능을 하는 것을 JAVA로 말한다면 instanceof키워드를 들 수 있다. is - 참조변수와 인스턴스를 비교해 형변환이 가능하다면 true 형변환이 불가하다면 false를 반환.as - 참조변수와 인스턴스를 비교해 형변환이 가능하다면 해당 인스턴스를 반환 아니라면 null을 반환 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58namespace ObjectApplication { class TestParent { internal..