org.eclipse.datatools.sqltools.core.services
Interface IConnectionService

All Known Implementing Classes:
DefaultConnectionService

public interface IConnectionService

A connection related service specific to a database definition.

Clients should extend DefaultConnectionService rather than implement this interface directly.

Author:
Hui Cao

Method Summary
 IControlConnection createControlConnection(DatabaseIdentifier databaseIdentifier)
          Returns an IControlConnection object which is used for all shared usage to that particular database.
 int getConnectionId(DatabaseIdentifier databaseIdentifier, java.sql.Connection conn)
          Returns an identifier for the connection.
 IConnectionInitializer getConnectionInitializer()
          Returns a IConnectionInitializer object which is used to initialize connection to proper state.
 java.lang.Runnable getConnectionKiller(DatabaseIdentifier databaseIdentifier, java.sql.Connection conn)
          Returns a Runnable which can be used to kill the connection.
 

Method Detail

getConnectionKiller

public java.lang.Runnable getConnectionKiller(DatabaseIdentifier databaseIdentifier,
                                              java.sql.Connection conn)
Returns a Runnable which can be used to kill the connection. This Runnable instance will be used to terminate a running statement. This is necessary because jdbc.sql.Statement.cancel() and jdbc.sql.Connection.close() wonĄŻt always be able to do the job.

Parameters:
databaseIdentifier - uniquely identifies a database
conn - the connection object
Returns:
a Runnable which can be used to kill the connection.

getConnectionId

public int getConnectionId(DatabaseIdentifier databaseIdentifier,
                           java.sql.Connection conn)
Returns an identifier for the connection. This id should be unique across all clients.

Parameters:
databaseIdentifier - uniquely identifies a database
conn - the connection object
Returns:
an identifier for the connection

createControlConnection

public IControlConnection createControlConnection(DatabaseIdentifier databaseIdentifier)
                                           throws java.sql.SQLException
Returns an IControlConnection object which is used for all shared usage to that particular database.

Parameters:
databaseIdentifier - uniquely identifies a database
Returns:
an IControlConnection object which is used for all shared usage to that particular database.
Throws:
java.sql.SQLException

getConnectionInitializer

public IConnectionInitializer getConnectionInitializer()
Returns a IConnectionInitializer object which is used to initialize connection to proper state. Clients may want to let end user customize the connection status by providing preference pages. The extension point preferenceSections is interesting to data server vendors if they want to contribute preference controls to an existing DTP preference page.

Returns:
a IConnectionInitializer object which is used to initialize connection to proper state.
See Also:
org.eclipse.datatools.common.ui.preferences.AbstractDBPreferenceFieldPage


Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.