Package org.eclipse.persistence.sessions
Interface Connector
-
- All Superinterfaces:
java.lang.Cloneable,java.io.Serializable
- All Known Implementing Classes:
DefaultConnector,DirectConnector,EISConnectionSpec,JNDIConnector
public interface Connector extends java.io.Serializable, java.lang.CloneablePurpose: Define an interface for supplying TopLink with aConnectionto a JDBC database.Description: This interface defines the methods to be implemented that allow TopLink to acquire a
Connectionto a JDBC database. There are only 2 methods that need to be implemented:
Once these methods have been implemented, an instance of the newjava.sql.Connection connect(java.util.Properties properties)
void toString(java.io.PrintWriter writer)Connectorcan be passed to aJDBCLoginat startup. For example:session.getLogin().setConnector(new FooConnector());
session.login();- See Also:
DatabaseLogin- Author:
- Big Country
- Since:
- TOPLink/Java 2.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectclone()INTERNAL: Must be cloneable.java.sql.Connectionconnect(java.util.Properties properties, Session session)INTERNAL: Connect with the specified properties and return theConnection.java.lang.StringgetConnectionDetails()INTERNAL: Provide the details of my connection information.voidtoString(java.io.PrintWriter writer)INTERNAL: Print something useful on the log.
-
-
-
Method Detail
-
clone
java.lang.Object clone()
INTERNAL: Must be cloneable.
-
connect
java.sql.Connection connect(java.util.Properties properties, Session session)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
void toString(java.io.PrintWriter writer)
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
java.lang.String getConnectionDetails()
INTERNAL: Provide the details of my connection information. This is primarily for JMX runtime services.- Returns:
- java.lang.String
-
-