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

java.lang.Object
  extended by kr.co.hit.live.transaction.datasource.DataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource

public class DataSource
extends Object
implements DataSource

Live의 DataSource 구현이다. WAS가 제공하는 Datasource와 Live가 제공하는 Datasource를 하나로 통합하는 역활을 한다.

Live의 Service Container에서 사용할 수 있는 형태로 만들었다.

Since:
4.0
Author:
김형도

Constructor Summary
DataSource()
           
 
Method Summary
 void close()
           
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
protected  DataSource getDataSource()
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 boolean isWrapperFor(Class<?> iface)
           
 void setAutocommit(boolean autocommit)
           
 void setDriver(String driver)
           
 void setDsn(String dsn)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 void setLookup(boolean use)
           
 void setMaxpool(int max)
           
 void setMinpool(int min)
           
 void setPassword(String password)
           
 void setReadTimeout(int sec)
           
 void setTimetowait(int sec)
           
 void setUrl(String url)
           
 void setUsername(String username)
           
 String toString()
           
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSource

public DataSource()
Method Detail

setDsn

public void setDsn(String dsn)

setLookup

public void setLookup(boolean use)

setDriver

public void setDriver(String driver)

setUrl

public void setUrl(String url)

setUsername

public void setUsername(String username)

setPassword

public void setPassword(String password)

setAutocommit

public void setAutocommit(boolean autocommit)

setMaxpool

public void setMaxpool(int max)

setMinpool

public void setMinpool(int min)

setTimetowait

public void setTimetowait(int sec)

setReadTimeout

public void setReadTimeout(int sec)

close

public void close()

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

getDataSource

protected DataSource getDataSource()
                            throws SQLException
Throws:
SQLException

toString

public String toString()
Overrides:
toString in class Object

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface Wrapper
Throws:
SQLException


Copyright © 2014. All Rights Reserved.