Package org.eclipse.persistence.sessions
Class DirectConnector
- java.lang.Object
-
- org.eclipse.persistence.sessions.DefaultConnector
-
- org.eclipse.persistence.sessions.DirectConnector
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Connector
public class DirectConnector extends DefaultConnector
Purpose:Use this Connector to build a java.sql.Connection by directly instantiating the Driver, as opposed to using the DriverManager.
- See Also:
- Serialized Form
- Author:
- Big Country
- Since:
- TOPLink/Java 2.1
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.sessions.DefaultConnector
databaseURL, driver, driverClass, driverClassName, driverURLHeader
-
-
Constructor Summary
Constructors Constructor Description DirectConnector()
PUBLIC: Construct a Connector with default settings (Sun JDBC-ODBC bridge).DirectConnector(java.lang.String driverClassName, java.lang.String driverURLHeader, java.lang.String databaseURL)
PUBLIC: Construct a Connector with the specified settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldUseDriverManager(java.util.Properties properties, Session session)
INTERNAL: Indicates whether DriverManager should be used.-
Methods inherited from class org.eclipse.persistence.sessions.DefaultConnector
clearDriverClassAndDriver, clone, connect, directConnect, getConnectionDetails, getConnectionString, getDatabaseURL, getDriverClassName, getDriverURLHeader, initialize, instantiateDriver, loadDriverClass, setDatabaseURL, setDriverClassName, setDriverURLHeader, toString, toString
-
-
-
-
Constructor Detail
-
DirectConnector
public DirectConnector()
PUBLIC: Construct a Connector with default settings (Sun JDBC-ODBC bridge). Although this does not really make sense for a "direct" Connector - the Sun JdbcOdbcDriver works fine with the DriverManager.
-
DirectConnector
public DirectConnector(java.lang.String driverClassName, java.lang.String driverURLHeader, java.lang.String databaseURL)
PUBLIC: Construct a Connector with the specified settings.
-
-
Method Detail
-
shouldUseDriverManager
public boolean shouldUseDriverManager(java.util.Properties properties, Session session)
INTERNAL: Indicates whether DriverManager should be used.- Overrides:
shouldUseDriverManager
in classDefaultConnector
- Returns:
- boolean
-
-