pk, fk, unique의 제약조건

http://egloos.zum.com/sweeper/v/3005563

자바 stack 사용하기

import java.util.Stack; public class StackExample {     public static void main(String[] args) {         Stack stack = new Stack<>();                  // 데이터 입력         stack.push(5);         stack.push(4);         stack.push(3);         stack.push(2);         stack.push(1);                  // 데이터 출력         System.out.println("마지막에 넣은 데이터부터 출력..");         System.out.println(stack.pop());         System.out.println(stack.pop());         System.out.println(stack.pop());         System.out.println(stack.pop()); ...

10진수<->2진수, 8진수, 16진수

자바 2진수, 8진수, 16진수 변환 시에는 Integer 클래스 API를 활용하면 편하다. (참고 :  https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html ) 10진수 -> 2진수, 8진수, 16진수 변환 1 2 3 4 5 6 7 8 int  num  =   77 ; String  a2  =  Integer.toBinaryString(num);   // 10진수 -> 2진수 String  a8 =  Integer.toOctalString(num);     // 10진수 -> 8진수 String  a16  =  Integer.toHexString(num);     // 10진수 -> 16진수 System . out . println ( "2 진수 : "   +  a2); System . out . println ( "8 진수 : "   +  a8); System . out . println ( "16 진수 : "   +  a16); cs 결과 1 2 3 2  진수 :  1001101 8  진수 :  115 16  진수 : 4d 2진수, 8진수, 16진수 -> 10진수로 변환 1 2 3 4 5 6 7 8 ...

MyLogger만들어서 print하기

public class MyLogger { private static boolean print = true; public static void Log(String str) { if(print) { System.out.println(str); } } public static void Log(String str, boolean flag) { if(print) { if(flag) System.out.println(str); } } }

동적프로그래밍(동전)

https://gist.github.com/developer-sdk/65e7f5491489a747040b1dd532cc7450

insert, update의 외래키 제약조건

http://tibang.tistory.com/entry/%EC%B0%B8%EC%A1%B0%ED%82%A4%EC%99%B8%EB%9E%98%ED%82%A4-FORIGN-KEY

String format 사용하기

http://blog.devez.net/100

최소공배수, 최대공약수

// 최소 공배수 계산 메서드   // 최소공배수는 엄청나게 큰 숫자가 나올 수도 있기에   // long형으로 다루어야 합니다.   public static long lcm(long a, long b) {     int gcd_value = gcd((int)a, (int)b);     if (gcd_value == 0) return 0; // 인수가 둘다 0일 때의 에러 처리     return Math.abs( (a * b) / gcd_value );   }   // 최대 공약수 계산 함수; 최소 공배수 계산에 필요함   // 최대 공약수는 그리 큰 숫자가 나오지 않기에 int형으로   public static int gcd(int a, int b) {     while (b != 0) {       int temp = a % b;       a = b;       b = temp;     }     return Math.abs(a);   } ============================================================================= 재귀함수로 최대공약수 구하기 public  static int getGcd ( int x ,  int y )      {          if ( x  %  y  ==   0 )   return  y ;          return  getGcd ( y ,  x ...

자릿수반환하기

public static int[] getNumbers(int number) { /*String[] strArr = String.valueOf(number).split(""); int[] result = new int[strArr.length]; for (int i = 0; i < strArr.length; i++) { result[i] = Integer.valueOf(strArr[i]); } return result;*/ List list = new ArrayList (); while(number!= 0) { list.add(number%10); number = number/10; } Collections.reverse(list); int[] result = new int[list.size()]; for (int i = 0; i < list.size(); i++) { result[i] = list.get(i); } return result; }

pattern 정규화 표현식 완전정복

http://highcode.tistory.com/6

정규식 pattern으로 확장자 골라내기

public boolean test(String str) { String allowPattern = ".+\\.(gul|ppt|xls|hwp|jpg|zip|tif|alz|bmp|pdf)$"; boolean result = false;         Pattern p = Pattern.compile(allowPattern);         Matcher m = p.matcher(str);         result = m.matches(); return result; }

oracle over함수 쓰임새

http://androphil.tistory.com/167 http://tibang.tistory.com/entry/%EC%98%A4%EB%9D%BC%ED%81%B4-%EB%B6%84%EC%84%9D-%ED%95%A8%EC%88%98-RANK-OVER-ROWNUMBER-OVER

math 함수 쓰기

Math함수 abs(double a) : 절대값 ceil(double a) : 값올림 floor(double a) : 값내림 round(double a):반올림 max(double a, double a) : 큰쪽반환 mins(double a, double b): 작은값 pow(double a, double b) : a의 b제곱 random() : 0~1사이 값을 랜덤으로 반환

not in, not exist의 차이 (null값이 있는 경우, not in은 null값을 없는값으로 침)

http://www.kkomzi.net/wordpress/128

sql like구문

http://makand.tistory.com/entry/SQL-LIKE-%EA%B5%AC%EB%AC%B8

between함수 사용하기

http://makand.tistory.com/entry/SQL-BETWEEN-%EA%B5%AC%EB%AC%B8

index를 효율적으로 선언하는방법( =, >= , between)

http://topboy.tistory.com/362

index를 타지 않는 경우

http://isstory83.tistory.com/131

Index 정리

http://hyun0412.tistory.com/entry/oracle-index-%EC%A0%95%EB%A6%AC

nvl, nvl2,

http://www.gurubee.net/lecture/1880