Package org.apache.openjpa.lib.jdbc
Class DelegatingDataSource
java.lang.Object
org.apache.openjpa.lib.jdbc.DelegatingDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,Closeable
- Direct Known Subclasses:
DecoratingDataSource
Wrapper around an existing data source. Subclasses can override the
methods whose behavior they mean to change. The
equals and
hashCode methods pass through to the base underlying data store.- Author:
- Abe White
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendInfo(StringBuffer buf) voidclose()booleangetConnection(String user, String pass) Return the wrapped data source.Return the inner-most wrapped delegate.intinthashCode()booleanisWrapperFor(Class iface) voidsetLoginTimeout(int timeout) voidsetLogWriter(PrintWriter out) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
DelegatingDataSource
Constructor. Supply wrapped data source.
-
-
Method Details
-
getDelegate
Return the wrapped data source. -
getInnermostDelegate
Return the inner-most wrapped delegate. -
hashCode
public int hashCode() -
equals
-
toString
-
appendInfo
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
close
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper
-
unwrap
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-