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