|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.datatools.sqltools.core.services.ConnectionService
public class ConnectionService
A connection related service specific to a database definition.
| Nested Class Summary | |
|---|---|
static interface |
ConnectionService.ConnectionProcessor
This interface can be implemented to do vendor-specific processing of the connection, e.g. |
| Constructor Summary | |
|---|---|
ConnectionService()
|
|
| Method Summary | |
|---|---|
void |
closeConnection(java.sql.Connection connection,
int connId,
DatabaseIdentifier databaseIdentifier)
Closes the connection object. |
java.sql.Connection |
createConnection(DatabaseIdentifier databaseIdentifier,
boolean usePool)
Returns a connection for caller to use. |
java.sql.Connection |
createConnection(java.lang.String profileName,
java.lang.String dbName)
Creates a jdbc connection from the given connection profile name and database name. |
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. |
ConnectionService.ConnectionProcessor |
getConnectionProcessor(DatabaseIdentifier databaseIdentifier)
Get an ConnectionProcessor |
java.util.Properties |
getDefaultConnectionProperties(java.lang.String profileName)
Returns the default properties of the given profile for creating a connection to that profile |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionService()
| Method Detail |
|---|
public java.lang.Runnable getConnectionKiller(DatabaseIdentifier databaseIdentifier,
java.sql.Connection conn)
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.
databaseIdentifier - uniquely identifies a databaseconn - the connection object
Runnable which can be used to kill the connection.
public int getConnectionId(DatabaseIdentifier databaseIdentifier,
java.sql.Connection conn)
databaseIdentifier - uniquely identifies a databaseconn - the connection object
public IControlConnection createControlConnection(DatabaseIdentifier databaseIdentifier)
throws java.sql.SQLException
databaseIdentifier - uniquely identifies a database
java.sql.SQLExceptionpublic IConnectionInitializer getConnectionInitializer()
org.eclipse.datatools.common.ui.preferences.AbstractDBPreferenceFieldPage
public java.sql.Connection createConnection(java.lang.String profileName,
java.lang.String dbName)
profileName - dbName -
public java.sql.Connection createConnection(DatabaseIdentifier databaseIdentifier,
boolean usePool)
throws java.sql.SQLException,
NoSuchProfileException
createConnection(String, String).
Vendors who has the requirement to use connection pool may override this method.
databaseIdentifier - the database identifierusePool - whether to retrieve the connection from connection pool.
Connection instance
java.sql.SQLException - if database error occurs
NoSuchProfileException
public java.util.Properties getDefaultConnectionProperties(java.lang.String profileName)
throws NoSuchProfileException
profileName - the profile name
NoSuchProfileException - if this profile does not exist
public void closeConnection(java.sql.Connection connection,
int connId,
DatabaseIdentifier databaseIdentifier)
throws java.sql.SQLException
connection - connId - databaseIdentifier -
java.sql.SQLExceptionpublic ConnectionService.ConnectionProcessor getConnectionProcessor(DatabaseIdentifier databaseIdentifier)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||