FileDocCategorySizeDatePackage
Connector.javaAPI DocGlassfish v2 API4001Tue May 22 16:54:52 BST 2007oracle.toplink.essentials.sessions

Connector

public interface Connector implements Serializable, Cloneable
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
DatabaseLogin
author
Big Country
since
TOPLink/Java 2.1

Fields Summary
Constructors Summary
Methods Summary
public java.lang.Objectclone()
PUBLIC: Must be cloneable.

public java.sql.Connectionconnect(java.util.Properties properties)
PUBLIC: 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).

return
java.sql.Connection

public java.lang.StringgetConnectionDetails()
PUBLIC: Provide the details of my connection information. This is primarily for JMX runtime services.

return
java.lang.String

public voidtoString(java.io.PrintWriter writer)
PUBLIC: Print something useful on the log. This information will be displayed on the TopLink log (by default System.out) at login. See the other implementations of this method for examples.