본문 바로가기

Java

(36)
DBCP Example (ManualPoolingDriverExample.java) /* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distribute..
DBCP Example (ManualPoolingDataSourceExample.java) /* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distribute..
DBCP Example (BasicDataSourceExample.java) 프로젝트중에서 우연한 기회에 프레임워크를 사용하지 않는 별도에 내부적으로 돌아가는 프로그램을 개발하기위해서 예전에 사용했던 DS를 테스트 해본다. BasicDataSourceExample /* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r..
diff Test
Synchronization Wrappers http://doc.ddart.net/java/tutorial/collections/implementations/wrapper.html public static Collection synchronizedCollection(Collection c); public static Set synchronizedSet(Set s); public static List synchronizedList(List list); public static Map synchronizedMap(Map m); public static SortedSet synchronizedSortedSet(SortedSet s); public static SortedMap synchronizedSortedMap(SortedMap m); List li..
equalsIgnoreCase() equal() 과 equalsIgnoreCase() 차이 equal은 문자열을 비교를 위해서 쓰인다. 물론 equalsIgnoreCase() 문자열 비교다. 하지만 크게 두가지 차이를 보인다. 첫째 비교시점시 글자길이를 먼저비교한다. 둘째 equalsIgnoreCase() 는 대소문자를 비교하지않는다. 첫번째 이유로 성능면에서는 equalsIgnoreCase() 가 더 빠르다. 하지만 둘중 어떤것을 사용할지는 개발자에 선택으로 사용하면 된다.
java1.5 셈플 java5 로 넘어오면서 많이 바꼈는데 가장 맘에드는건 저너릭스와 enum 타입이 생긴것이다. annotation 은 어떤곳에 써야할지 아직은 감이 안잡힌다. 1. static 멤버 import 하기 - static import 를 사용하면 클래스명을 안쓰고 static 멤버변수와 static 메소드에 접근할수 있다. import static java.lang.Math.*; public class StaticImportTest { public static void main(String args[]) { double y = sin(1.2); System.out.println("SIN(1.2) : " + y); System.out.println("PI : " + PI); } } 2. Eunumerated 타..
[JAVA1.5] JDK 1.5 Sample Code 원문 : http://blog.naver.com/sj99yang/140002147454 JDK 1.5 has some very useful enhancements.  Thanks to Josh Bloch of Sun Microsystems for helpful hints.Early Access: there is an interactive version of this page here where you can post your code fragments to the community at large.--------------------------------------------------------------------------------------1.AutoboxingJava's distinction ..