Package org.eclipse.persistence.sessions
Interface Connector
- All Superinterfaces:
Cloneable
,Serializable
- All Known Implementing Classes:
DefaultConnector
,DirectConnector
,EISConnectionSpec
,JNDIConnector
,OracleOCIProxyConnector
Purpose:
Define an interface for supplying TopLink with a
Connection
to
a JDBC database.
Description:
This interface defines the methods to be implemented that allow TopLink to
acquire a Connection
to a JDBC database. There are only 2
methods that need to be implemented:
java.sql.Connection connect(java.util.Properties properties)
void toString(java.io.PrintWriter writer)
Once these methods have been implemented, an instance of the new
Connector
can be passed
to a JDBCLogin
at startup. For example:
session.getLogin().setConnector(new FooConnector());
session.login();
- See Also:
- Author:
- Big Country
-
Method Summary
Modifier and TypeMethodDescriptionclone()
INTERNAL: Must be cloneable.connect
(Properties properties, Session session) INTERNAL: Connect with the specified properties and return theConnection
.INTERNAL: Provide the details of my connection information.void
toString
(PrintWriter writer) INTERNAL: Print something useful on the log.
-
Method Details
-
clone
Object clone()INTERNAL: Must be cloneable. -
connect
INTERNAL: Connect with the specified properties and return theConnection
. The properties are driver-specific; but usually contain the"user"
and"password"
. Additional properties can be built by usingJDBCLogin.setProperty(String propertyName, Object propertyValue)
.- Returns:
- java.sql.Connection
-
toString
INTERNAL: Print something useful on the log. This information will be displayed on the EclipseLink log (by defaultSystem.out
) at login. See the other implementations of this method for examples. -
getConnectionDetails
String getConnectionDetails()INTERNAL: Provide the details of my connection information. This is primarily for JMX runtime services.- Returns:
- java.lang.String
-