Package org.hibernate.testing.jdbc
Class DataSourceStub
- java.lang.Object
-
- org.hibernate.testing.jdbc.DataSourceStub
-
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
public class DataSourceStub extends Object implements DataSource
-
-
Constructor Summary
Constructors Constructor Description DataSourceStub(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
getConnection()
Connection
getConnection(String username, String password)
String
getId()
int
getLoginTimeout()
PrintWriter
getLogWriter()
Logger
getParentLogger()
boolean
isWrapperFor(Class<?> iface)
void
setLoginTimeout(int seconds)
void
setLogWriter(PrintWriter out)
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
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
-
-
-
Constructor Detail
-
DataSourceStub
public DataSourceStub(String id)
-
-
Method Detail
-
getId
public String getId()
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
public Connection getConnection(String username, String password)
- Specified by:
getConnection
in interfaceDataSource
-
getLogWriter
public PrintWriter getLogWriter()
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
-
setLogWriter
public void setLogWriter(PrintWriter out)
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds)
- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()
- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
-
getParentLogger
public Logger getParentLogger()
- Specified by:
getParentLogger
in interfaceCommonDataSource
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
- Specified by:
isWrapperFor
in interfaceWrapper
-
-