mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@249 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -12,8 +12,8 @@ public class HADataSource implements DataSource {
|
||||
|
||||
private final List<DataSource> dataSources = new CopyOnWriteArrayList<DataSource>();
|
||||
|
||||
private int loginTimeout = 0;
|
||||
private PrintWriter logWriter = new PrintWriter(System.out);
|
||||
private int loginTimeout = 0;
|
||||
private PrintWriter logWriter = new PrintWriter(System.out);
|
||||
|
||||
public List<DataSource> getDataSources() {
|
||||
return dataSources;
|
||||
@@ -40,13 +40,30 @@ public class HADataSource implements DataSource {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T unwrap(Class<T> iface) throws SQLException {
|
||||
return null;
|
||||
public boolean isWrapperFor(Class<?> iface) throws SQLException {
|
||||
if (iface == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (iface.isInstance(this)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean isWrapperFor(Class<?> iface) throws SQLException {
|
||||
return false;
|
||||
public <T> T unwrap(Class<T> iface) throws SQLException {
|
||||
if (iface == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (iface.isInstance(this)) {
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,7 +73,7 @@ public class HADataSource implements DataSource {
|
||||
|
||||
@Override
|
||||
public Connection getConnection(String username, String password) throws SQLException {
|
||||
return null;
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user