Top Description Methods
org.eclipse.persistence.sessions

public Interface Connector

extends Serializable, Cloneable
Known Direct Implementers
org.eclipse.persistence.sessions.DefaultConnector, org.eclipse.persistence.sessions.JNDIConnector, org.eclipse.persistence.eis.EISConnectionSpec
Imports
java.util.*, java.sql.*, java.io.*

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();
Author
Big Country
Since
TOPLink/Java 2.1
See Also
DatabaseLogin

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

INTERNAL: Must be cloneable.

public Connection

Returns:

java.sql.Connection
connect
(Properties properties, Session session)

INTERNAL: Connect with the specified properties and return the Connection.

public String

Returns:

java.lang.String
getConnectionDetails
()

INTERNAL: Provide the details of my connection information.

public void
toString(PrintWriter writer)

INTERNAL: Print something useful on the log.

Method Detail

cloneback to summary
public Object clone()

INTERNAL: Must be cloneable.

connectback to summary
public Connection connect(Properties properties, Session session)

INTERNAL: Connect with the specified properties and return the Connection. The properties are driver-specific; but usually contain the "user" and "password". Additional properties can be built by using JDBCLogin.setProperty(String propertyName, Object propertyValue).

Returns:Connection

java.sql.Connection

getConnectionDetailsback to summary
public String getConnectionDetails()

INTERNAL: Provide the details of my connection information. This is primarily for JMX runtime services.

Returns:String

java.lang.String

toStringback to summary
public void toString(PrintWriter writer)

INTERNAL: Print something useful on the log. This information will be displayed on the EclipseLink log (by default System.out) at login. See the other implementations of this method for examples.