Package org.apache.openjpa.jdbc.schema
Class SimpleDriverDataSource
- java.lang.Object
-
- org.apache.openjpa.jdbc.schema.SimpleDriverDataSource
-
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,DriverDataSource
- Direct Known Subclasses:
DBCPDriverDataSource
public class SimpleDriverDataSource extends Object implements DriverDataSource
Non-pooling driver data source.
-
-
Constructor Summary
Constructors Constructor Description SimpleDriverDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ConnectionDecorator>createConnectionDecorators()Provide any built-in decorators; may be null.ClassLoadergetClassLoader()Classloader for loading driver class, etc.ConnectiongetConnection()ConnectiongetConnection(String username, String password)ConnectiongetConnection(Properties props)StringgetConnectionDriverName()Driver class name.PropertiesgetConnectionFactoryProperties()Configuration of datasource properties.protected StringgetConnectionPassword()PropertiesgetConnectionProperties()Configuration of connection.StringgetConnectionURL()JDBC URL.StringgetConnectionUserName()JDBC user name.intgetLoginTimeout()PrintWritergetLogWriter()LoggergetParentLogger()protected ConnectiongetSimpleConnection(Properties props)protected DrivergetSimpleDriver()voidinitDBDictionary(DBDictionary dict)Initialize self and dictionary once available.booleanisWrapperFor(Class<?> iface)voidsetClassLoader(ClassLoader classLoader)JDBC password.voidsetConnectionDriverName(String connectionDriverName)Driver class name.voidsetConnectionFactoryProperties(Properties props)Configuration of datasource properties.voidsetConnectionPassword(String connectionPassword)JDBC password.voidsetConnectionProperties(Properties props)Configuration of connection.voidsetConnectionURL(String connectionURL)JDBC URL.voidsetConnectionUserName(String connectionUserName)JDBC user name.voidsetLoginTimeout(int seconds)voidsetLogWriter(PrintWriter out)Objectunwrap(Class iface)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
-
-
-
Method Detail
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
public Connection getConnection(String username, String password) throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
public Connection getConnection(Properties props) throws SQLException
- Throws:
SQLException
-
getSimpleConnection
protected Connection getSimpleConnection(Properties props) throws SQLException
- Throws:
SQLException
-
getLoginTimeout
public int getLoginTimeout()
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds)
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource
-
getLogWriter
public PrintWriter getLogWriter()
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource
-
setLogWriter
public void setLogWriter(PrintWriter out)
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource
-
initDBDictionary
public void initDBDictionary(DBDictionary dict)
Description copied from interface:DriverDataSourceInitialize self and dictionary once available.- Specified by:
initDBDictionaryin interfaceDriverDataSource
-
setConnectionURL
public void setConnectionURL(String connectionURL)
Description copied from interface:DriverDataSourceJDBC URL.- Specified by:
setConnectionURLin interfaceDriverDataSource
-
getConnectionURL
public String getConnectionURL()
Description copied from interface:DriverDataSourceJDBC URL.- Specified by:
getConnectionURLin interfaceDriverDataSource
-
setConnectionUserName
public void setConnectionUserName(String connectionUserName)
Description copied from interface:DriverDataSourceJDBC user name.- Specified by:
setConnectionUserNamein interfaceDriverDataSource
-
getConnectionUserName
public String getConnectionUserName()
Description copied from interface:DriverDataSourceJDBC user name.- Specified by:
getConnectionUserNamein interfaceDriverDataSource
-
setConnectionPassword
public void setConnectionPassword(String connectionPassword)
Description copied from interface:DriverDataSourceJDBC password.- Specified by:
setConnectionPasswordin interfaceDriverDataSource
-
getConnectionPassword
protected String getConnectionPassword()
-
setConnectionProperties
public void setConnectionProperties(Properties props)
Description copied from interface:DriverDataSourceConfiguration of connection.- Specified by:
setConnectionPropertiesin interfaceDriverDataSource
-
getConnectionProperties
public Properties getConnectionProperties()
Description copied from interface:DriverDataSourceConfiguration of connection.- Specified by:
getConnectionPropertiesin interfaceDriverDataSource
-
setConnectionFactoryProperties
public void setConnectionFactoryProperties(Properties props)
Description copied from interface:DriverDataSourceConfiguration of datasource properties.- Specified by:
setConnectionFactoryPropertiesin interfaceDriverDataSource
-
getConnectionFactoryProperties
public Properties getConnectionFactoryProperties()
Description copied from interface:DriverDataSourceConfiguration of datasource properties.- Specified by:
getConnectionFactoryPropertiesin interfaceDriverDataSource
-
createConnectionDecorators
public List<ConnectionDecorator> createConnectionDecorators()
Description copied from interface:DriverDataSourceProvide any built-in decorators; may be null.- Specified by:
createConnectionDecoratorsin interfaceDriverDataSource
-
setClassLoader
public void setClassLoader(ClassLoader classLoader)
Description copied from interface:DriverDataSourceJDBC password.- Specified by:
setClassLoaderin interfaceDriverDataSource
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from interface:DriverDataSourceClassloader for loading driver class, etc.- Specified by:
getClassLoaderin interfaceDriverDataSource
-
setConnectionDriverName
public void setConnectionDriverName(String connectionDriverName)
Description copied from interface:DriverDataSourceDriver class name.- Specified by:
setConnectionDriverNamein interfaceDriverDataSource
-
getConnectionDriverName
public String getConnectionDriverName()
Description copied from interface:DriverDataSourceDriver class name.- Specified by:
getConnectionDriverNamein interfaceDriverDataSource
-
getSimpleDriver
protected Driver getSimpleDriver()
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
- Specified by:
isWrapperForin interfaceWrapper
-
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
-