사용자 도구

사이트 도구


java:jdbc

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
java:jdbc [2017/12/18 16:30]
kwon37xi
java:jdbc [2021/02/16 18:24] (현재)
kwon37xi [SQL Logging]
줄 7: 줄 7:
   * [[http://www.java2s.com/Tutorials/Java/JDBC/index.htm|Java2s JDBC Tutorial]]   * [[http://www.java2s.com/Tutorials/Java/JDBC/index.htm|Java2s JDBC Tutorial]]
  
 +===== Timeout =====
 +  * DB 연결 설정에서 Timeout은 매우 중요한 부분임. 모두 설정하고 의미 숙지
 +  * [[http://d2.naver.com/helloworld/1321|JDBC Internal - 타임아웃의 이해]]
 +  * connection timeout
 +  * socket timeout
 +  * statement timeout(query timeout)
 +  * 각 Connection Pool에서 커넥션을 가져오는 최대 대기시간 설정도 꼭 해준다. connection timeout보다 약간 더 길게 하면 될까?
 ===== 편리 라이브러리 ===== ===== 편리 라이브러리 =====
   * [[java:jinq|Jinq]]   * [[java:jinq|Jinq]]
줄 13: 줄 20:
   * [[springframework:jdbc|Springframework JDBC]]   * [[springframework:jdbc|Springframework JDBC]]
   * [[java:fluent_jdbc|Fluent JDBC]]   * [[java:fluent_jdbc|Fluent JDBC]]
 +  * [[java:jdbc:datasource_proxy|DataSource Proxy]]
 +
 ===== SQL Logging ===== ===== SQL Logging =====
 +  * 대부분의 JDBC Driver는 자체적으로 logging 기능을 끄고 켤 수 있는 경우가 많다.
   * [[http://zer0.free.fr/craftsman/spy.php|Craftsman Spy 1.0.5]] : SQL 구문, 실행 시간등을 일괄적으로 로그로 남길 수 있다.   * [[http://zer0.free.fr/craftsman/spy.php|Craftsman Spy 1.0.5]] : SQL 구문, 실행 시간등을 일괄적으로 로그로 남길 수 있다.
     * [[http://java.dzone.com/articles/logging-spring-jdbc-and|Logging with Spring JDBC and Craftsman Spy]]     * [[http://java.dzone.com/articles/logging-spring-jdbc-and|Logging with Spring JDBC and Craftsman Spy]]
   * [[http://www.javabeat.net/2012/06/new-features-jdbc-3-0/|New Features of JDBC 3.0]]   * [[http://www.javabeat.net/2012/06/new-features-jdbc-3-0/|New Features of JDBC 3.0]]
 +  * [[https://github.com/p6spy/p6spy|P6Spy]]
   * [[https://code.google.com/p/log4jdbc-log4j2/|Log4jdbc-log4j2]] : JDBC 로깅 with log4j2 and slf4j   * [[https://code.google.com/p/log4jdbc-log4j2/|Log4jdbc-log4j2]] : JDBC 로깅 with log4j2 and slf4j
   * [[https://vladmihalcea.com/2016/05/03/the-best-way-of-logging-jdbc-statements/|The best way of logging JDBC statements]]   * [[https://vladmihalcea.com/2016/05/03/the-best-way-of-logging-jdbc-statements/|The best way of logging JDBC statements]]
 +  * [[java:jdbc:datasource_proxy|DataSource Proxy]]
 ===== Db 접속 테스트. 가장 기본 JDBC 접속 및 쿼리 ===== ===== Db 접속 테스트. 가장 기본 JDBC 접속 및 쿼리 =====
 <code java> <code java>
줄 57: 줄 68:
  
 </code> </code>
 +  * Java 6, JDBC 4.0 부터는 ''Class.forName()''이 불필요하다. [[https://www.mkyong.com/jdbc/jdbc-class-forname-is-no-longer-required/|JDBC Class.forName() is no longer required – Mkyong.com]]
  
 ===== JDBC Driver ===== ===== JDBC Driver =====
줄 152: 줄 164:
   * [[http://openhms.sourceforge.net/sqlbuilder/|Builder style classes for creating SQL queries]]   * [[http://openhms.sourceforge.net/sqlbuilder/|Builder style classes for creating SQL queries]]
   * [[https://examples.javacodegeeks.com/core-java/sql/jdbc-resultsetextractor-example/|JDBC ResultSetExtractor Example | Examples Java Code Geeks - 2017]]   * [[https://examples.javacodegeeks.com/core-java/sql/jdbc-resultsetextractor-example/|JDBC ResultSetExtractor Example | Examples Java Code Geeks - 2017]]
 +  * [[http://www.baeldung.com/jdbc-batch-processing|Batch Processing in JDBC]]
 +  * [[https://www.javaworld.com/article/3388036/what-is-jdbc-introduction-to-java-database-connectivity.html|What is JDBC? Introduction to Java Database Connectivity | JavaWorld]]
java/jdbc.1513584053.txt.gz · 마지막으로 수정됨: 2017/12/18 16:30 저자 kwon37xi