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.ClassLoader
getClassLoader()
Classloader for loading driver class, etc.Connection
getConnection()
Connection
getConnection(String username, String password)
Connection
getConnection(Properties props)
String
getConnectionDriverName()
Driver class name.Properties
getConnectionFactoryProperties()
Configuration of datasource properties.protected String
getConnectionPassword()
Properties
getConnectionProperties()
Configuration of connection.String
getConnectionURL()
JDBC URL.String
getConnectionUserName()
JDBC user name.int
getLoginTimeout()
PrintWriter
getLogWriter()
Logger
getParentLogger()
protected Connection
getSimpleConnection(Properties props)
protected Driver
getSimpleDriver()
void
initDBDictionary(DBDictionary dict)
Initialize self and dictionary once available.boolean
isWrapperFor(Class<?> iface)
void
setClassLoader(ClassLoader classLoader)
JDBC password.void
setConnectionDriverName(String connectionDriverName)
Driver class name.void
setConnectionFactoryProperties(Properties props)
Configuration of datasource properties.void
setConnectionPassword(String connectionPassword)
JDBC password.void
setConnectionProperties(Properties props)
Configuration of connection.void
setConnectionURL(String connectionURL)
JDBC URL.void
setConnectionUserName(String connectionUserName)
JDBC user name.void
setLoginTimeout(int seconds)
void
setLogWriter(PrintWriter out)
Object
unwrap(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:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
public Connection getConnection(String username, String password) throws SQLException
- Specified by:
getConnection
in 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:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds)
- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
-
getLogWriter
public PrintWriter getLogWriter()
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
-
setLogWriter
public void setLogWriter(PrintWriter out)
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
-
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(String connectionURL)
Description copied from interface:DriverDataSource
JDBC URL.- Specified by:
setConnectionURL
in interfaceDriverDataSource
-
getConnectionURL
public String getConnectionURL()
Description copied from interface:DriverDataSource
JDBC URL.- Specified by:
getConnectionURL
in interfaceDriverDataSource
-
setConnectionUserName
public void setConnectionUserName(String connectionUserName)
Description copied from interface:DriverDataSource
JDBC user name.- Specified by:
setConnectionUserName
in interfaceDriverDataSource
-
getConnectionUserName
public String getConnectionUserName()
Description copied from interface:DriverDataSource
JDBC user name.- Specified by:
getConnectionUserName
in interfaceDriverDataSource
-
setConnectionPassword
public void setConnectionPassword(String connectionPassword)
Description copied from interface:DriverDataSource
JDBC password.- Specified by:
setConnectionPassword
in interfaceDriverDataSource
-
getConnectionPassword
protected String getConnectionPassword()
-
setConnectionProperties
public void setConnectionProperties(Properties props)
Description copied from interface:DriverDataSource
Configuration of connection.- Specified by:
setConnectionProperties
in interfaceDriverDataSource
-
getConnectionProperties
public Properties getConnectionProperties()
Description copied from interface:DriverDataSource
Configuration of connection.- Specified by:
getConnectionProperties
in interfaceDriverDataSource
-
setConnectionFactoryProperties
public void setConnectionFactoryProperties(Properties props)
Description copied from interface:DriverDataSource
Configuration of datasource properties.- Specified by:
setConnectionFactoryProperties
in interfaceDriverDataSource
-
getConnectionFactoryProperties
public Properties getConnectionFactoryProperties()
Description copied from interface:DriverDataSource
Configuration of datasource properties.- Specified by:
getConnectionFactoryProperties
in interfaceDriverDataSource
-
createConnectionDecorators
public 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(ClassLoader classLoader)
Description copied from interface:DriverDataSource
JDBC password.- Specified by:
setClassLoader
in interfaceDriverDataSource
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from interface:DriverDataSource
Classloader for loading driver class, etc.- Specified by:
getClassLoader
in interfaceDriverDataSource
-
setConnectionDriverName
public void setConnectionDriverName(String connectionDriverName)
Description copied from interface:DriverDataSource
Driver class name.- Specified by:
setConnectionDriverName
in interfaceDriverDataSource
-
getConnectionDriverName
public String getConnectionDriverName()
Description copied from interface:DriverDataSource
Driver class name.- Specified by:
getConnectionDriverName
in interfaceDriverDataSource
-
getSimpleDriver
protected Driver getSimpleDriver()
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
- Specified by:
isWrapperFor
in interfaceWrapper
-
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLogger
in interfaceCommonDataSource
- Throws:
SQLFeatureNotSupportedException
-
-