public interface Connector
extends java.io.Serializable, java.lang.Cloneable
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();
DatabaseLogin
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
INTERNAL:
Must be cloneable.
|
java.sql.Connection |
connect(java.util.Properties properties,
Session session)
INTERNAL:
Connect with the specified properties and return the
Connection . |
java.lang.String |
getConnectionDetails()
INTERNAL:
Provide the details of my connection information.
|
void |
toString(java.io.PrintWriter writer)
INTERNAL:
Print something useful on the log.
|
java.lang.Object clone()
java.sql.Connection connect(java.util.Properties properties, Session session)
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)
.void toString(java.io.PrintWriter writer)
System.out
) at login.
See the other implementations of this method for examples.java.lang.String getConnectionDetails()