kr.co.hit.live.transaction.datasource
Class StandardPooledDataSource

java.lang.Object
  extended by kr.co.hit.live.transaction.datasource.PooledDataSource
      extended by kr.co.hit.live.transaction.datasource.StandardPooledDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource
Direct Known Subclasses:
DB2PooledDataSource, DerbyPooledDataSource, MysqlPooledDataSource, OraclePooledDataSource, TiberoPooledDataSource

public class StandardPooledDataSource
extends PooledDataSource


Field Summary
protected  ConnectionPoolDataSource cpds
           PooledConnection 객체를 생성할 때 사용할 ConnectionPoolDataSource 객체
 
Fields inherited from class kr.co.hit.live.transaction.datasource.PooledDataSource
datasourceName, jdbcAutoCommit, jdbcDriver, jdbcPassword, jdbcUrl, jdbcUsername, poolMaxActive, poolMaxIdle, poolTimeToWait, readTimeout
 
Constructor Summary
StandardPooledDataSource(Properties prop)
           
 
Method Summary
protected  Connection afterGetConnection(Connection con)
           getConnection() 에서 Connection를 리턴하기 전에 호출되는 메소드이다.
protected  PooledConnection createPooledConnection()
           새로운 PooledConnection 객체를 생성한다.
 int getLoginTimeout()
           javax.sql.DataSourcegetLoginTimeout() Operation을 구현한다.
 PrintWriter getLogWriter()
           javax.sql.DataSourcegetLogWriter() Operation을 구현한다.
 boolean isWrapperFor(Class<?> iface)
           
 void setConnectionPoolDataSource(ConnectionPoolDataSource ds)
           
 void setLoginTimeout(int seconds)
           javax.sql.DataSourcesetLoginTimeout() Operation을 구현한다.
 void setLogWriter(PrintWriter out)
           javax.sql.DataSourcesetLogWriter() Operation을 구현한다.
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class kr.co.hit.live.transaction.datasource.PooledDataSource
clear, getConnection, getConnection, getDatasourceName, getPooledConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cpds

protected ConnectionPoolDataSource cpds

PooledConnection 객체를 생성할 때 사용할 ConnectionPoolDataSource 객체

Constructor Detail

StandardPooledDataSource

public StandardPooledDataSource(Properties prop)
Method Detail

setConnectionPoolDataSource

public void setConnectionPoolDataSource(ConnectionPoolDataSource ds)

createPooledConnection

protected PooledConnection createPooledConnection()
                                           throws SQLException
Description copied from class: PooledDataSource

새로운 PooledConnection 객체를 생성한다. 하위 클래스에서 구현한다.

Specified by:
createPooledConnection in class PooledDataSource
Returns:
생성된 PooledConnection 객체
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Description copied from class: PooledDataSource

javax.sql.DataSourcegetLogWriter() Operation을 구현한다. 하위 클래스에서 구현한다.

Specified by:
getLogWriter in interface CommonDataSource
Specified by:
getLogWriter in class PooledDataSource
Returns:
log writer 객체를 리턴, 설정되지 않은 경우에는 null을 리턴
Throws:
SQLException - 데이터베이스 에러가 발생할 때

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Description copied from class: PooledDataSource

javax.sql.DataSourcegetLoginTimeout() Operation을 구현한다. 하위 클래스에서 구현한다.

Specified by:
getLoginTimeout in interface CommonDataSource
Specified by:
getLoginTimeout in class PooledDataSource
Returns:
데이터베이스 로그인 최대 시간(초)
Throws:
SQLException - 데이터베이스 에러가 발생할 때

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Description copied from class: PooledDataSource

javax.sql.DataSourcesetLogWriter() Operation을 구현한다. 하위 클래스에서 구현한다.

Specified by:
setLogWriter in interface CommonDataSource
Specified by:
setLogWriter in class PooledDataSource
Parameters:
out - 설정할 log writer 객체
Throws:
SQLException - 데이터베이스 에러가 발생할 때

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Description copied from class: PooledDataSource

javax.sql.DataSourcesetLoginTimeout() Operation을 구현한다. 하위 클래스에서 구현한다.

Specified by:
setLoginTimeout in interface CommonDataSource
Specified by:
setLoginTimeout in class PooledDataSource
Parameters:
seconds - 데이터베이스 로그인 최대 시간(초)
Throws:
SQLException - 데이터베이스 에러가 발생할 때

afterGetConnection

protected Connection afterGetConnection(Connection con)
                                 throws SQLException
Description copied from class: PooledDataSource

getConnection() 에서 Connection를 리턴하기 전에 호출되는 메소드이다. 리턴하기 전에 Connection 객체에 Vendor 별로 고유한 설정이 필요한 경우 여기에 구현한다. 하위 클래스에서 구현한다.

Specified by:
afterGetConnection in class PooledDataSource
Parameters:
con - 추가 설정을 할 connection 객체
Returns:
Connection 객체
Throws:
SQLException

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Throws:
SQLException


Copyright © 2014. All Rights Reserved.