Class DataSourceImpl
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.jdbc.DataSourceImpl
-
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
public class DataSourceImpl extends Object implements DataSource
A stubbed out impl of DataSource that can be used for testing. Does not support multiple threads or multiple usernames/passwords.
-
-
Constructor Summary
Constructors Constructor Description DataSourceImpl(String dsName, String url, String userName, String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectiongetConnection()ConnectiongetConnection(String userName, String password)intgetLoginTimeout()PrintWritergetLogWriter()StringgetName()LoggergetParentLogger()ConnectioninternalGetConnection()ConnectioninternalGetConnection(String userName, String password)booleanisTransactional()booleanisWrapperFor(Class<?> iface)voidsetLoginTimeout(int seconds)voidsetLogWriter(PrintWriter out)voidsetTransactionManager(TransactionManagerImpl tm)<T> Tunwrap(Class<T> iface)
-
-
-
Method Detail
-
getName
public String getName()
-
setTransactionManager
public void setTransactionManager(TransactionManagerImpl tm)
-
internalGetConnection
public Connection internalGetConnection(String userName, String password) throws SQLException
- Throws:
SQLException
-
internalGetConnection
public Connection internalGetConnection() throws SQLException
- Throws:
SQLException
-
isTransactional
public boolean isTransactional()
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
public Connection getConnection(String userName, String password) throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getLogWriter
public PrintWriter getLogWriter() throws SQLException
- Specified by:
getLogWriterin interfaceCommonDataSource- Throws:
SQLException
-
setLogWriter
public void setLogWriter(PrintWriter out) throws SQLException
- Specified by:
setLogWriterin interfaceCommonDataSource- Throws:
SQLException
-
getLoginTimeout
public int getLoginTimeout() throws SQLException- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Throws:
SQLException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws SQLException- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
getParentLogger
public Logger getParentLogger()
- Specified by:
getParentLoggerin interfaceCommonDataSource
-
-