org.apache.openjpa.slice.jdbc
Class DistributedDataSource
java.lang.Object
   org.apache.openjpa.lib.jdbc.DelegatingDataSource
org.apache.openjpa.lib.jdbc.DelegatingDataSource
       org.apache.openjpa.lib.jdbc.DecoratingDataSource
org.apache.openjpa.lib.jdbc.DecoratingDataSource
           org.apache.openjpa.slice.jdbc.DistributedDataSource
org.apache.openjpa.slice.jdbc.DistributedDataSource
- All Implemented Interfaces: 
- Iterable<DataSource>, Wrapper, CommonDataSource, DataSource, Closeable
- public class DistributedDataSource 
- extends DecoratingDataSource- implements Iterable<DataSource>
A virtual datasource that contains many physical datasources.
- Author:
- Pinaki Poddar
 
 
 
 
 
DistributedDataSource
public DistributedDataSource(List<DataSource> dataSources)
addDataSource
public void addDataSource(DataSource ds)
- 
 
- 
 
getConnection
Connection getConnection(DataSource ds)
                   throws SQLException
- 
 
- 
- Throws:
- SQLException
 
getConnection
Connection getConnection(DataSource ds,
                         String user,
                         String pwd)
                   throws SQLException
- 
 
- 
- Throws:
- SQLException
 
iterator
public Iterator<DataSource> iterator()
- 
- Specified by:
- iteratorin interface- Iterable<DataSource>
 
- 
 
getConnection
public Connection getConnection()
                         throws SQLException
- 
- Specified by:
- getConnectionin interface- DataSource
- Overrides:
- getConnectionin class- DecoratingDataSource
 
- 
- Throws:
- SQLException
 
getConnection
public Connection getConnection(String username,
                                String password)
                         throws SQLException
- 
- Specified by:
- getConnectionin interface- DataSource
- Overrides:
- getConnectionin class- DecoratingDataSource
 
- 
- Throws:
- SQLException
 
getLogWriter
public PrintWriter getLogWriter()
                         throws SQLException
- 
- Specified by:
- getLogWriterin interface- CommonDataSource
- Overrides:
- getLogWriterin class- DelegatingDataSource
 
- 
- Throws:
- SQLException
 
getLoginTimeout
public int getLoginTimeout()
                    throws SQLException
- 
- Specified by:
- getLoginTimeoutin interface- CommonDataSource
- Overrides:
- getLoginTimeoutin class- DelegatingDataSource
 
- 
- Throws:
- SQLException
 
setLogWriter
public void setLogWriter(PrintWriter out)
                  throws SQLException
- 
- Specified by:
- setLogWriterin interface- CommonDataSource
- Overrides:
- setLogWriterin class- DelegatingDataSource
 
- 
- Throws:
- SQLException
 
setLoginTimeout
public void setLoginTimeout(int seconds)
                     throws SQLException
- 
- Specified by:
- setLoginTimeoutin interface- CommonDataSource
- Overrides:
- setLoginTimeoutin class- DelegatingDataSource
 
- 
- Throws:
- SQLException
 
getParentLogger
public Logger getParentLogger()
                       throws SQLFeatureNotSupportedException
- 
- Overrides:
- getParentLoggerin class- DelegatingDataSource
 
- 
- Throws:
- SQLFeatureNotSupportedException
 
Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.