프로그래밍/자바 6

iBatis 삽질의 추억

아. iBatis. 오늘 transaction을 명시적으로 적용한 (SqlMapClient.startTransaction() ) 함수를 하나 맹글었는데, 사실 그동안 iBatis에서 transaction을 쓸 일이 별로 없었다규. 이거이 쓰고 나면 딱 커넥션풀 갯수만큼만 잘 되고 그 다음부터는 커넥션풀을 얻어오지 못했다는 타임아웃 에러가 나고 먹통이 되어버린다. 밥먹고 와서 삽질한 결과, 드뎌 알아냈다. iBatis에서 startTransaction을 했거든 commitTransaction만 하지 말고 꼭 endTransaction도 하라는 것. 이런 형태면 된다. try { SqlMapClient.startTransaction(); ..... SqlMapClient.commitTransaction();..

iBatis에서 iterate 쓰기 : 여러개의 or이나 in 안에 여러 개의 데이터 넣기

자바에서는 이렇게 한다. ArrayList arCapacity = new ArrayList(); String[] arResult = strCapacity.trim().split(","); // 검색어를 목록에 담는다. for (int i = 0; i < arResult.length; i++) arCapacity.add(arResult[i]); List list; try { list = m_client.queryForList("searchMemberCapacity", arCapacity); } catch(SQLException ex) { ex.printStackTrace(); return ""; } 이걸 iBatis XML에서는 select member.EMP_NO from member where and ..

maven2에는 컴파일할 소스 디렉토리의 위치가 default로 정해져 있었다!

소스 디렉토리의 위치를 조정하니 maven에서 compile할 파일이 없다는 메시지가 나왔다. 아놔. 혹시 struts처럼 기본값이 있나 해서 알아봤더니 역시나였다. 굳이 소스 디렉토리의 default 값을 적지는 않겠다. 대부분 그걸 쓰고 있을테니. pom.xml에서 아래의 부분을 수정해 줘야 한다. ${artifactId}-${version} src src/main/resources

maven2에서 java.nio.BufferOverflowException 에러 발생시 - 소스코드 인코딩,encoding과 OS가 다를 때 처리

허걱. maven2에서 [INFO] Compilation failure Failure executing javac, but could not parse the error: An exception has occurred in the compiler (1.5.0_19). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. java.nio.BufferOverflowException a..