Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.sessions
Interface Connector

All Superinterfaces:
  java.lang.Cloneable, java.io.Serializable

All Known Implementing Classes:
  DefaultConnector, EISConnectionSpec, JNDIConnector

public interface Connector
extends java.io.Serializable, java.lang.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();`

Since:
  TOPLink/Java 2.1
See Also:
  `DatabaseLogin`

Method Summary
`java.lang.Object` | `clone()` PUBLIC: Must be cloneable.
`java.sql.Connection` | `connect(java.util.Properties properties)` PUBLIC: Connect with the specified properties and return the `Connection`.
`java.lang.String` | `getConnectionDetails()` PUBLIC: Provide the details of my connection information.
`void` | `toString(java.io.PrintWriter writer)` PUBLIC: Print something useful on the log.

Method Detail

### clone

    public java.lang.Object clone()

  PUBLIC: Must be cloneable.

### connect

    public java.sql.Connection connect(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)`.
  Returns:
    java.sql.Connection

### toString

    public void toString(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.

### getConnectionDetails

    public java.lang.String getConnectionDetails()

  PUBLIC: Provide the details of my connection information. This is primarily for JMX runtime services.
  Returns:
    java.lang.String

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD