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.ClassLoader
getClassLoader()
Classloader for loading driver class, etc.java.sql.Connection
getConnection()
java.sql.Connection
getConnection(java.lang.String username, java.lang.String password)
java.sql.Connection
getConnection(java.util.Properties props)
java.lang.String
getConnectionDriverName()
Driver class name.java.util.Properties
getConnectionFactoryProperties()
Configuration of datasource properties.protected java.lang.String
getConnectionPassword()
java.util.Properties
getConnectionProperties()
Configuration of connection.java.lang.String
getConnectionURL()
JDBC URL.java.lang.String
getConnectionUserName()
JDBC user name.int
getLoginTimeout()
java.io.PrintWriter
getLogWriter()
java.util.logging.Logger
getParentLogger()
protected java.sql.Connection
getSimpleConnection(java.util.Properties props)
protected java.sql.Driver
getSimpleDriver()
void
initDBDictionary(DBDictionary dict)
Initialize self and dictionary once available.boolean
isWrapperFor(java.lang.Class<?> iface)
void
setClassLoader(java.lang.ClassLoader classLoader)
JDBC password.void
setConnectionDriverName(java.lang.String connectionDriverName)
Driver class name.void
setConnectionFactoryProperties(java.util.Properties props)
Configuration of datasource properties.void
setConnectionPassword(java.lang.String connectionPassword)
JDBC password.void
setConnectionProperties(java.util.Properties props)
Configuration of connection.void
setConnectionURL(java.lang.String connectionURL)
JDBC URL.void
setConnectionUserName(java.lang.String connectionUserName)
JDBC user name.void
setLoginTimeout(int seconds)
void
setLogWriter(java.io.PrintWriter out)
java.lang.Object
unwrap(java.lang.Class iface)
-
-
-
Method Detail
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLException
- Specified by:
getConnection
in 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:
getConnection
in 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:
getLoginTimeout
in interfacejavax.sql.CommonDataSource
- Specified by:
getLoginTimeout
in interfacejavax.sql.DataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds)
- Specified by:
setLoginTimeout
in interfacejavax.sql.CommonDataSource
- Specified by:
setLoginTimeout
in interfacejavax.sql.DataSource
-
getLogWriter
public java.io.PrintWriter getLogWriter()
- Specified by:
getLogWriter
in interfacejavax.sql.CommonDataSource
- Specified by:
getLogWriter
in interfacejavax.sql.DataSource
-
setLogWriter
public void setLogWriter(java.io.PrintWriter out)
- Specified by:
setLogWriter
in interfacejavax.sql.CommonDataSource
- Specified by:
setLogWriter
in interfacejavax.sql.DataSource
-
initDBDictionary
public void initDBDictionary(DBDictionary dict)
Description copied from interface:DriverDataSource
Initialize self and dictionary once available.- Specified by:
initDBDictionary
in interfaceDriverDataSource
-
setConnectionURL
public void setConnectionURL(java.lang.String connectionURL)
Description copied from interface:DriverDataSource
JDBC URL.- Specified by:
setConnectionURL
in interfaceDriverDataSource
-
getConnectionURL
public java.lang.String getConnectionURL()
Description copied from interface:DriverDataSource
JDBC URL.- Specified by:
getConnectionURL
in interfaceDriverDataSource
-
setConnectionUserName
public void setConnectionUserName(java.lang.String connectionUserName)
Description copied from interface:DriverDataSource
JDBC user name.- Specified by:
setConnectionUserName
in interfaceDriverDataSource
-
getConnectionUserName
public java.lang.String getConnectionUserName()
Description copied from interface:DriverDataSource
JDBC user name.- Specified by:
getConnectionUserName
in interfaceDriverDataSource
-
setConnectionPassword
public void setConnectionPassword(java.lang.String connectionPassword)
Description copied from interface:DriverDataSource
JDBC password.- Specified by:
setConnectionPassword
in interfaceDriverDataSource
-
getConnectionPassword
protected java.lang.String getConnectionPassword()
-
setConnectionProperties
public void setConnectionProperties(java.util.Properties props)
Description copied from interface:DriverDataSource
Configuration of connection.- Specified by:
setConnectionProperties
in interfaceDriverDataSource
-
getConnectionProperties
public java.util.Properties getConnectionProperties()
Description copied from interface:DriverDataSource
Configuration of connection.- Specified by:
getConnectionProperties
in interfaceDriverDataSource
-
setConnectionFactoryProperties
public void setConnectionFactoryProperties(java.util.Properties props)
Description copied from interface:DriverDataSource
Configuration of datasource properties.- Specified by:
setConnectionFactoryProperties
in interfaceDriverDataSource
-
getConnectionFactoryProperties
public java.util.Properties getConnectionFactoryProperties()
Description copied from interface:DriverDataSource
Configuration of datasource properties.- Specified by:
getConnectionFactoryProperties
in interfaceDriverDataSource
-
createConnectionDecorators
public java.util.List<ConnectionDecorator> createConnectionDecorators()
Description copied from interface:DriverDataSource
Provide any built-in decorators; may be null.- Specified by:
createConnectionDecorators
in interfaceDriverDataSource
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
Description copied from interface:DriverDataSource
JDBC password.- Specified by:
setClassLoader
in interfaceDriverDataSource
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Description copied from interface:DriverDataSource
Classloader for loading driver class, etc.- Specified by:
getClassLoader
in interfaceDriverDataSource
-
setConnectionDriverName
public void setConnectionDriverName(java.lang.String connectionDriverName)
Description copied from interface:DriverDataSource
Driver class name.- Specified by:
setConnectionDriverName
in interfaceDriverDataSource
-
getConnectionDriverName
public java.lang.String getConnectionDriverName()
Description copied from interface:DriverDataSource
Driver class name.- Specified by:
getConnectionDriverName
in interfaceDriverDataSource
-
getSimpleDriver
protected java.sql.Driver getSimpleDriver()
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface)
- Specified by:
isWrapperFor
in interfacejava.sql.Wrapper
-
unwrap
public java.lang.Object unwrap(java.lang.Class iface)
- Specified by:
unwrap
in interfacejava.sql.Wrapper
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
- Specified by:
getParentLogger
in interfacejavax.sql.CommonDataSource
- Throws:
java.sql.SQLFeatureNotSupportedException
-
-