org.apache.openjpa.slice.jdbc
Class DistributedDataSource
java.lang.Object
org.apache.openjpa.lib.jdbc.DelegatingDataSource
org.apache.openjpa.lib.jdbc.DecoratingDataSource
org.apache.openjpa.slice.jdbc.DistributedDataSource
- All Implemented Interfaces:
- Iterable<DataSource>, Wrapper, CommonDataSource, DataSource, org.apache.openjpa.lib.util.Closeable
public class DistributedDataSource
- extends org.apache.openjpa.lib.jdbc.DecoratingDataSource
- implements Iterable<DataSource>
A virtual datasource that contains many physical datasources.
- Author:
- Pinaki Poddar
| Methods inherited from class org.apache.openjpa.lib.jdbc.DecoratingDataSource |
addDecorator, addDecorators, clearDecorators, getDecorators, removeDecorator |
| Methods inherited from class org.apache.openjpa.lib.jdbc.DelegatingDataSource |
appendInfo, close, equals, getDelegate, getInnermostDelegate, hashCode, isWrapperFor, toString, unwrap |
DistributedDataSource
public DistributedDataSource(List<DataSource> dataSources)
addDataSource
public void addDataSource(DataSource ds)
iterator
public Iterator<DataSource> iterator()
- Specified by:
iterator in interface Iterable<DataSource>
getConnection
public Connection getConnection()
throws SQLException
- Specified by:
getConnection in interface DataSource- Overrides:
getConnection in class org.apache.openjpa.lib.jdbc.DecoratingDataSource
- Throws:
SQLException
getConnection
public Connection getConnection(String username,
String password)
throws SQLException
- Specified by:
getConnection in interface DataSource- Overrides:
getConnection in class org.apache.openjpa.lib.jdbc.DecoratingDataSource
- Throws:
SQLException
getLogWriter
public PrintWriter getLogWriter()
throws SQLException
- Specified by:
getLogWriter in interface CommonDataSource- Overrides:
getLogWriter in class org.apache.openjpa.lib.jdbc.DelegatingDataSource
- Throws:
SQLException
getLoginTimeout
public int getLoginTimeout()
throws SQLException
- Specified by:
getLoginTimeout in interface CommonDataSource- Overrides:
getLoginTimeout in class org.apache.openjpa.lib.jdbc.DelegatingDataSource
- Throws:
SQLException
setLogWriter
public void setLogWriter(PrintWriter out)
throws SQLException
- Specified by:
setLogWriter in interface CommonDataSource- Overrides:
setLogWriter in class org.apache.openjpa.lib.jdbc.DelegatingDataSource
- Throws:
SQLException
setLoginTimeout
public void setLoginTimeout(int seconds)
throws SQLException
- Specified by:
setLoginTimeout in interface CommonDataSource- Overrides:
setLoginTimeout in class org.apache.openjpa.lib.jdbc.DelegatingDataSource
- Throws:
SQLException
getParentLogger
public Logger getParentLogger()
throws SQLFeatureNotSupportedException
- Overrides:
getParentLogger in class org.apache.openjpa.lib.jdbc.DelegatingDataSource
- Throws:
SQLFeatureNotSupportedException
Copyright © 2006–2015 Apache Software Foundation. All rights reserved.