Package com.jcabi.jdbc
Class StaticSource
- java.lang.Object
-
- com.jcabi.jdbc.StaticSource
-
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
public final class StaticSource extends Object implements DataSource
Static data source which wraps a singleConnection.- Since:
- 0.10
-
-
Constructor Summary
Constructors Constructor Description StaticSource(Connection cnx)Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectiongetConnection()ConnectiongetConnection(String username, String password)intgetLoginTimeout()PrintWritergetLogWriter()LoggergetParentLogger()booleanisWrapperFor(Class<?> iface)voidsetLoginTimeout(int seconds)voidsetLogWriter(PrintWriter writer)<T> Tunwrap(Class<T> iface)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
-
-
-
Constructor Detail
-
StaticSource
public StaticSource(Connection cnx)
Public ctor.- Parameters:
cnx- Connection
-
-
Method Detail
-
getConnection
public Connection getConnection()
- Specified by:
getConnectionin interfaceDataSource
-
getConnection
public Connection getConnection(String username, String password)
- Specified by:
getConnectionin interfaceDataSource
-
getLogWriter
public PrintWriter getLogWriter()
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource
-
setLogWriter
public void setLogWriter(PrintWriter writer)
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds)
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource
-
getParentLogger
public Logger getParentLogger()
- Specified by:
getParentLoggerin interfaceCommonDataSource
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
- Specified by:
isWrapperForin interfaceWrapper
-
-