본문 바로가기

Be an Overachiever

검색하기
Be an Overachiever
프로필사진 devson119

  • 분류 전체보기 (13)
    • Programming Language (1)
      • Java (1)
      • Javascript (0)
    • Spring (1)
    • 서버 (4)
      • Apache (4)
    • DB (0)
      • Redis (0)
    • Tip (4)
      • Programming (2)
      • Eclipse (2)
    • ETC (1)
    • ㅎㅅㅎ (0)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/12   »
일 월 화 수 목 금 토
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
Tags
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Programming Language (1)

Be an Overachiever

AutoCloseable interface

AutoCloseable interface를 통해 코드를 깔끔하게 리팩토링 해보자. JDBC를 사용할 경우 마지막에 connection 객체를 close() 처리를 해주어야한다. 이 경우 주로 finally 문에서 close() 처리를 한다. 12345678910Connection connection = null; try { connection = pool.getConnection(); // do something} catch (ConnectionException e) { LOGGER.error("Connection Exception 발생");} finally { connection.close();}Colored by Color Scriptercs 하지만 만약 pool에서 connection 객체를 가져..

Programming Language/Java 2018. 8. 21. 22:53
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바