프로그래밍 156

NIO

JDK 1.5에는 서버 애플리케이션을 만드는데 필요한 거의 모든것이 다 들어가 있는 듯하다. 아래 포스트한 Thread Pool이외에서 JDK 1.4 부터 포함된 NIO에서는 Socket에 대한 Multiplexing이 가능한 API를 제공한다. http://www.onjava.com/pub/a/onjava/2002/10/02/javanio.html http://www.onjava.com/pub/a/onjava/2002/09/04/nio.html 고객사에 이슈가 있어서 검토중인데.. 간만에 재미있는 장난감 찾았다... 정리되면 나중에 다시 포스팅 해야겠다. ^^

JDK 1.5 부터 등장한 ThreadPool

Thread Pool이라는 것이 얼핏 생각하면 구현이 간단할 수 도 있지만, 막상 구현하려면 상당히 귀찮은데, JDK 1.5에 이 내용이 포함되어 있다. 상당히 설계도 잘한것 같아서 마음에 드는데.. 이정도면 쉽게 웹서버정도는 만들 수 있지 않을까? http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ThreadPoolExecutor.html#execute(java.lang.Runnable) 생성자를 잠깐 살펴보면 ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, ThreadFactory ..

대용량 Record select

게시판 리스트등 가지고 오는데 유용하겠다. Stmt.setFetchSize 를 이용할것.. ===== 참고: ResultSet에서도 FetchSize 적용가능. 양쪽에 차이점과 성능 테스트는 시간날때 정리 필요 e244. Setting the Number of Rows to Prefetch When Executing a SQL Query When a SQL query is executed, the number of rows of data that a driver physically copies from the database to the client is called the fetch size. If you are performance-tuning a particular query, you might b..