org.eclipse.datatools.sqltools.editor.core.connection
Interface ISQLEditorConnectionInfo

All Known Implementing Classes:
SQLBuilderConnectionInfo, SQLEditorConnectionInfo

public interface ISQLEditorConnectionInfo

This interface defines all the connection information require by a SQLEditor.

Author:
Hui Cao

Method Summary
 java.lang.String encode()
          Encodes the given ISQLEditorConnectionInfo object for persistency.
 IConnectionProfile getConnectionProfile()
          Gets the IConnectionProfile object associated with this input.
 java.lang.String getConnectionProfileName()
          Gets the IConnectionProfile name associated with this input.
 Database getDatabase()
          Gets the Database object associated with this input.
 java.lang.String getDatabaseName()
          Gets the database name associated with this input.
 org.eclipse.datatools.modelbase.dbdefinition.DatabaseVendorDefinition getDatabaseVendorDefinition()
          Gets the DatabaseVendorDefinition object associated with this input.
 org.eclipse.datatools.sqltools.core.DatabaseVendorDefinitionId getDatabaseVendorDefinitionId()
          Gets the DatabaseVendorDefinitionId object associated with this input.
 java.lang.String getDefaultSchemaName()
          Gets the default schema name to use with the connection or database associated with this input.
 java.lang.String getName()
          Gets a String representing this object.
 int getProfileStatus()
           
 java.sql.Connection getSharedConnection()
          Retrieves the shared connection.
 boolean isConnected()
           
 void setConnectionProfileName(java.lang.String profileName)
          Sets the IConnectionProfile name associated with this input to the given object.
 void setDatabase(Database database)
          Sets the Database object associated with this input to the given object.
 void setDatabaseVendorDefinitionId(org.eclipse.datatools.sqltools.core.DatabaseVendorDefinitionId dbVendorDefId)
          Sets the DatabaseVendorDefinitionId associated with this input to the given object.
 void setDefaultSchemaName(java.lang.String schemaName)
          Sets the default schema name to use with the connection or database associated with this input.
 void setProfileStatus(int status)
           
 

Method Detail

getName

java.lang.String getName()
Gets a String representing this object. Contains vendor definition, connection profile name and database name if any.

Returns:
connection name

getDatabaseVendorDefinition

org.eclipse.datatools.modelbase.dbdefinition.DatabaseVendorDefinition getDatabaseVendorDefinition()
Gets the DatabaseVendorDefinition object associated with this input. The DatabaseVendorDefinition object contains the information needed to do parsing, syntax highlighting, and syntax validation.

Returns:
the DatabaseVendorDefinition object associated with this input, can never be null. A default DatabaseVendorDefinition object will be return if not specified.

getDatabaseVendorDefinitionId

org.eclipse.datatools.sqltools.core.DatabaseVendorDefinitionId getDatabaseVendorDefinitionId()
Gets the DatabaseVendorDefinitionId object associated with this input. The DatabaseVendorDefinitionId object identifies a DatabaseVendorDefinition object

Returns:
the DatabaseVendorDefinitionId object associated with this input, can never be null. A default DatabaseVendorDefinitionId object will be return if not specified.

getConnectionProfile

IConnectionProfile getConnectionProfile()
Gets the IConnectionProfile object associated with this input. The IConnectionProfile object contains the information needed to connect to a database.

Returns:
the IConnectionProfile object associated with this input or null if none or profile name is invalid

getConnectionProfileName

java.lang.String getConnectionProfileName()
Gets the IConnectionProfile name associated with this input. The IConnectionProfile object contains the information needed to connect to a database.

Returns:
the IConnectionProfile name associated with this input or null if none

getDatabase

Database getDatabase()
Gets the Database object associated with this input. The Database object provides access to database metadata (catalog) information.

Returns:
the Database object associated with this input, or null if none

getDatabaseName

java.lang.String getDatabaseName()
Gets the database name associated with this input.

Returns:
the database name associated with this input, or null if none
See Also:
getDatabase()

getDefaultSchemaName

java.lang.String getDefaultSchemaName()
Gets the default schema name to use with the connection or database associated with this input.

Returns:
the default schema name to use with this input, or null if none

setConnectionProfileName

void setConnectionProfileName(java.lang.String profileName)
Sets the IConnectionProfile name associated with this input to the given object.

Parameters:
profileName - the IConnectionProfile name to set

setDatabase

void setDatabase(Database database)
Sets the Database object associated with this input to the given object.

Parameters:
database - the Database object to set

setDefaultSchemaName

void setDefaultSchemaName(java.lang.String schemaName)
Sets the default schema name to use with the connection or database associated with this input. TODO register connection listener on connection profile to set the schema name here

Parameters:
schemaname - the default schema name to set

setDatabaseVendorDefinitionId

void setDatabaseVendorDefinitionId(org.eclipse.datatools.sqltools.core.DatabaseVendorDefinitionId dbVendorDefId)
Sets the DatabaseVendorDefinitionId associated with this input to the given object.

Parameters:
dbVendorDefId - the DatabaseVendorDefinitionId object to set

getSharedConnection

java.sql.Connection getSharedConnection()
Retrieves the shared connection.

Returns:
if no shared connection set, return null.

encode

java.lang.String encode()
Encodes the given ISQLEditorConnectionInfo object for persistency.

Parameters:
info -
Returns:
A encoded String
See Also:
decode()

getProfileStatus

int getProfileStatus()

setProfileStatus

void setProfileStatus(int status)

isConnected

boolean isConnected()