CommonDataSource

CommonDataSource (공통 데이터 소스 인터페이스)

DataSource, XADataSource, ConnectionPoolDataSource 사이에 공통인 메서드를 정의하는 인터페이스입니다.

출처: Java API Reference

본문

이 인터페이스에 정의된 공통 메서드로는 로그 기록을 위한 getLogWriter/setLogWriter, 로그인 타임아웃을 위한 setLoginTimeout/getLoginTimeout, 부모 Logger를 반환하는 getParentLogger, ShardingKeyBuilder 인스턴스를 만드는 createShardingKeyBuilder가 있습니다.

데이터 소스 객체를 만들 때 로그 기록자는 처음에 null이며, 즉 기본적으로 로깅이 비활성화되어 있어요. 로그인 타임아웃도 처음에 0이며, 0은 기본 시스템 타임아웃(있을 경우)을, 그렇지 않으면 타임아웃이 없음을 의미합니다.

PrintWriter getLogWriter() throws SQLException
void setLogWriter(PrintWriter out) throws SQLException
void setLoginTimeout(int seconds) throws SQLException
int getLoginTimeout() throws SQLException
Logger getParentLogger() throws SQLFeatureNotSupportedException
default ShardingKeyBuilder createShardingKeyBuilder() throws SQLException

더 알아보기 (Learn more)

Java 공식 API