org.apache.openjpa.jdbc.schema
Class DataSourceFactory.DefaultsDataSource

java.lang.Object
  extended by org.apache.openjpa.lib.jdbc.DelegatingDataSource
      extended by org.apache.openjpa.jdbc.schema.DataSourceFactory.DefaultsDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, Closeable
Enclosing class:
DataSourceFactory

protected abstract static class DataSourceFactory.DefaultsDataSource
extends DelegatingDataSource

A data source with pre-configured default user name and password.


Constructor Summary
DataSourceFactory.DefaultsDataSource(DataSource ds, String user, String pass)
           
 
Method Summary
 Connection getConnection()
           
 Connection getConnection(String user, String pass)
           
static DataSourceFactory.DefaultsDataSource newInstance(DataSource ds, String user, String pass)
           
 
Methods inherited from class org.apache.openjpa.lib.jdbc.DelegatingDataSource
appendInfo, close, enforceAbstract, equals, getDelegate, getInnermostDelegate, getLoginTimeout, getLogWriter, hashCode, isWrapperFor, newInstance, setLoginTimeout, setLogWriter, toString, unwrap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSourceFactory.DefaultsDataSource

public DataSourceFactory.DefaultsDataSource(DataSource ds,
                                            String user,
                                            String pass)
Method Detail

newInstance

public static DataSourceFactory.DefaultsDataSource newInstance(DataSource ds,
                                                               String user,
                                                               String pass)

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class DelegatingDataSource
Throws:
SQLException

getConnection

public Connection getConnection(String user,
                                String pass)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Overrides:
getConnection in class DelegatingDataSource
Throws:
SQLException


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.