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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendInfo
(StringBuffer buf) void
close()
boolean
getConnection
(String user, String pass) Return the wrapped data source.Return the inner-most wrapped delegate.int
int
hashCode()
boolean
isWrapperFor
(Class iface) void
setLoginTimeout
(int timeout) void
setLogWriter
(PrintWriter out) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
Methods 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:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
close
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
-
unwrap
-
getParentLogger
- Specified by:
getParentLogger
in interfaceCommonDataSource
- Throws:
SQLFeatureNotSupportedException
-