org.eclipse.datatools.connectivity.sqm.internal.core.connection
Interface ConnectionInfo


public interface ConnectionInfo


Field Summary
static java.lang.String CONNECTION
           
static java.lang.String FILTER
           
static java.lang.String INFO_FILE_EXTENSION
           
 
Method Summary
 boolean addConnectionSharingListener(ConnectionSharingListener listener)
          Register a listener to sharing events.
 void addDependentProject(IProject proj)
          Add a dependent project.
 void addFilter(java.lang.String key, ConnectionFilter filter)
          set a filter.
 boolean addFilterListener(ConnectionFilterListener listener)
          Add a filterListener
 void cacheDatabase(Database database)
          Cache a database in the workspace.
 void discoverDatabaseDefinitionWhenConnect()
          Flag for auto-detecting vendor and version when connect.
 Database getCachedDatabase()
          Load a database from workspace cache.
 long getCachedDatabaseTimestamp()
           
 DatabaseDefinition getDatabaseDefinition()
           
 java.lang.String getDatabaseName()
           
 java.lang.String getDatabaseProductVersion()
           
 IProject[] getDependentProjects()
          Retrive all dependent projects
 java.lang.String getDriverClassName()
           
 ConnectionFilter getFilter(java.lang.String key)
          return the filter
 java.util.Iterator getFilters()
          return all the connection filters
 java.lang.String getIdentifierQuoteString()
           
 java.lang.String getLoadingPath()
           
 java.lang.String getName()
          A user friendly name of the connection info.
 java.lang.String getPassword()
          Helper function for property "password".
 java.util.Properties getProperties()
           
 java.sql.Connection getSharedConnection()
          Retrive the shared connection.
 Database getSharedDatabase()
          retrieve the shared database
 java.lang.String getURL()
           
 java.lang.String getUserName()
          Helper function for property "user".
 boolean isDiscoverDatabaseDefinitionWhenConnectEnabled()
           
 boolean removeConnectionSharingListener(ConnectionSharingListener listener)
          Remove a listener
 void removeDependentProject(IProject proj)
          Remove a dependent project.
 void removeFilter(java.lang.String key)
          remove the filter
 boolean removeFilterListener(ConnectionFilterListener listener)
          Remove filterListener
 void removeSharedConnection()
          Remove the shared connection.
 void removeSharedDatabase()
          Remove the shared database.
 void setDatabaseName(java.lang.String databasename)
           
 void setDriverClassName(java.lang.String className)
           
 void setLoadingPath(java.lang.String path)
          specify the extra class path to load the driver class.
 void setName(java.lang.String name)
          Change the connection info name.
 void setPassword(java.lang.String password)
          Helper function for property "password".
 void setSharedConnection(java.sql.Connection connection)
          Share a connection.
 void setSharedDatabase(Database database)
          Share a database associated to this connection info.
 void setURL(java.lang.String url)
           
 void setUserName(java.lang.String id)
          Helper function for property "user".
 

Field Detail

CONNECTION

public static final java.lang.String CONNECTION
See Also:
Constant Field Values

INFO_FILE_EXTENSION

public static final java.lang.String INFO_FILE_EXTENSION
See Also:
Constant Field Values

FILTER

public static final java.lang.String FILTER
See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
A user friendly name of the connection info.

Returns:
the connection info name - null means it is not named.

setName

public void setName(java.lang.String name)
Change the connection info name.

Parameters:
name - - a user friendly name. It cannot be null.

getDatabaseDefinition

public DatabaseDefinition getDatabaseDefinition()
Returns:
the database definition associated to this connection info

getLoadingPath

public java.lang.String getLoadingPath()
Returns:
the driver class loading path

setLoadingPath

public void setLoadingPath(java.lang.String path)
specify the extra class path to load the driver class.

Parameters:
path - semicolon separated class path

getDriverClassName

public java.lang.String getDriverClassName()
Returns:
the JDBC driver class full name.

setDriverClassName

public void setDriverClassName(java.lang.String className)
Parameters:
className - the driver class full name.

getURL

public java.lang.String getURL()
Returns:
JDBC connection URL

setURL

public void setURL(java.lang.String url)
Parameters:
url - JDBC connection URL

getUserName

public java.lang.String getUserName()
Helper function for property "user". The value can be accessed directly using Properties

Returns:
value of property "user"

setUserName

public void setUserName(java.lang.String id)
Helper function for property "user". The value can be set directly using Properties

Parameters:
id - value of property "user"

getPassword

public java.lang.String getPassword()
Helper function for property "password". The value can be accessed directly using Properties

Returns:
value of property "password"

setPassword

public void setPassword(java.lang.String password)
Helper function for property "password". The value can be set directly using Properties

Parameters:
password - value of property "password"

getDatabaseName

public java.lang.String getDatabaseName()

setDatabaseName

public void setDatabaseName(java.lang.String databasename)

getIdentifierQuoteString

public java.lang.String getIdentifierQuoteString()

getDatabaseProductVersion

public java.lang.String getDatabaseProductVersion()

getProperties

public java.util.Properties getProperties()
Returns:
the properties for JDBC connection

discoverDatabaseDefinitionWhenConnect

public void discoverDatabaseDefinitionWhenConnect()
Flag for auto-detecting vendor and version when connect.


isDiscoverDatabaseDefinitionWhenConnectEnabled

public boolean isDiscoverDatabaseDefinitionWhenConnectEnabled()
Returns:
true is the auto-detection of vendor and version is set on connect - false otherwise

setSharedConnection

public void setSharedConnection(java.sql.Connection connection)
Share a connection. If there is a shared connection already, an IllegalStateException will be thrown. If the function succeeds, notification will be sent out to all registered listeners

Parameters:
connection - a live JDBC connection

getSharedConnection

public java.sql.Connection getSharedConnection()
Retrive the shared connection.

Returns:
if no shared connection set, return null.

removeSharedConnection

public void removeSharedConnection()
Remove the shared connection. If no shared connection set, an IllegalStateException will be thrown. If the function succeeds, notification will be sent out to all registered listeners


setSharedDatabase

public void setSharedDatabase(Database database)
Share a database associated to this connection info. If there is a shared database already, an IllegalStateException will be thrown. If the function succeeds, notification will be sent out to all registered listeners

Parameters:
database -

getSharedDatabase

public Database getSharedDatabase()
retrieve the shared database

Returns:
if no shared databsae set, return null

removeSharedDatabase

public void removeSharedDatabase()
Remove the shared database. If no shared database set, an IllegalStateException will be thrown. If the function succeeds, notification will be sent out to all registered listeners


addConnectionSharingListener

public boolean addConnectionSharingListener(ConnectionSharingListener listener)
Register a listener to sharing events.

Parameters:
listener -

removeConnectionSharingListener

public boolean removeConnectionSharingListener(ConnectionSharingListener listener)
Remove a listener

Parameters:
listener -

cacheDatabase

public void cacheDatabase(Database database)
                   throws java.io.IOException
Cache a database in the workspace. It could be a time consuming task.

Parameters:
database -
Throws:
java.io.IOException

getCachedDatabase

public Database getCachedDatabase()
Load a database from workspace cache.

Returns:

getCachedDatabaseTimestamp

public long getCachedDatabaseTimestamp()

addFilter

public void addFilter(java.lang.String key,
                      ConnectionFilter filter)
set a filter.

Parameters:
key -
filter -

getFilter

public ConnectionFilter getFilter(java.lang.String key)
return the filter

Parameters:
key -
Returns:

removeFilter

public void removeFilter(java.lang.String key)
remove the filter

Parameters:
key -
Returns:

getFilters

public java.util.Iterator getFilters()
return all the connection filters


getDependentProjects

public IProject[] getDependentProjects()
Retrive all dependent projects

Returns:

addDependentProject

public void addDependentProject(IProject proj)
Add a dependent project. If the project is already in the list, it will be ignored.

Parameters:
proj -

removeDependentProject

public void removeDependentProject(IProject proj)
Remove a dependent project. If the project is not in the list, it will be ignored.

Parameters:
proj -

addFilterListener

public boolean addFilterListener(ConnectionFilterListener listener)
Add a filterListener

Parameters:
listener -
Returns:

removeFilterListener

public boolean removeFilterListener(ConnectionFilterListener listener)
Remove filterListener

Parameters:
listener -
Returns:


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