org.eclipse.datatools.sqltools.core.services
Class DefaultConnectionService

java.lang.Object
  extended byorg.eclipse.datatools.sqltools.core.services.DefaultConnectionService
All Implemented Interfaces:
IConnectionService

public class DefaultConnectionService
extends java.lang.Object
implements IConnectionService

Default implementation for IConnectionService.

Author:
Hui Cao

Constructor Summary
DefaultConnectionService()
           
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConnectionService

public DefaultConnectionService()
Method Detail

getConnectionKiller

public java.lang.Runnable getConnectionKiller(DatabaseIdentifier databaseIdentifier,
                                              java.sql.Connection conn)
Description copied from interface: IConnectionService
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.

Specified by:
getConnectionKiller in interface IConnectionService
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)
Description copied from interface: IConnectionService
Returns an identifier for the connection. This id should be unique across all clients.

Specified by:
getConnectionId in interface IConnectionService
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
Description copied from interface: IConnectionService
Returns an IControlConnection object which is used for all shared usage to that particular database.

Specified by:
createControlConnection in interface IConnectionService
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()
Description copied from interface: IConnectionService
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.

Specified by:
getConnectionInitializer in interface IConnectionService
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.