## org.eclipse.datatools.sqltools.sqlbuilder.model
Class SQLBuilderConnectionInfo

    java.lang.Object
      org.eclipse.datatools.sqltools.sqleditor.SQLEditorConnectionInfo
          org.eclipse.datatools.sqltools.sqlbuilder.model.SQLBuilderConnectionInfo

All Implemented Interfaces:
  ISQLEditorConnectionInfo

    public class SQLBuilderConnectionInfo

extends SQLEditorConnectionInfo

This class extends SQLEditorConnectionInfo so that a ConnectionInfo object can be constructed from a ConnectionProfile.

Author:
  Jeremy Lindop

Field Summary

Fields inherited from class org.eclipse.datatools.sqltools.sqleditor.SQLEditorConnectionInfo
`DEFAULT_SQLEDITOR_CONNECTION_INFO`

Constructor Summary
`SQLBuilderConnectionInfo(IConnectionProfile connectionProfile)` Constructs a `SQLBuilderConnectionInfo` by `ConnectionProfile`.

Method Summary
`java.lang.String` `encode()` Encodes the given `SQLBuilderConnectionInfo` object for persistence
`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.sql.Connection` `getSharedConnection()` Retrieves the sharable connection from IControlConnection, which in turn delegates to the connectivity layer.

Methods inherited from class org.eclipse.datatools.sqltools.sqleditor.SQLEditorConnectionInfo
`decode, getDatabaseName, getDatabaseVendorDefinition, getDatabaseVendorDefinitionId, getDefaultSchemaName, getName, getProfileStatus, isConnected, setConnectionProfileName, setDatabase, setDatabaseName, setDatabaseVendorDefinitionId, setDefaultSchemaName, setProfileStatus`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SQLBuilderConnectionInfo

    public SQLBuilderConnectionInfo(IConnectionProfile connectionProfile)

  Constructs a `SQLBuilderConnectionInfo` by `ConnectionProfile`.

  Parameters:
    `connectionProfile` - `IConnectionProfile`

Method Detail

### getConnectionProfile

    public IConnectionProfile getConnectionProfile()

  Description copied from interface: `ISQLEditorConnectionInfo`
  Gets the `IConnectionProfile` object associated with this input. The `IConnectionProfile` object contains the information needed to connect to a database.

  Specified by:
    `getConnectionProfile` in interface `ISQLEditorConnectionInfo`
  Overrides:
    `getConnectionProfile` in class `SQLEditorConnectionInfo`
  Returns:
    the `IConnectionProfile` object associated with this input or `null` if none or profile name is invalid

### getConnectionProfileName

    public java.lang.String getConnectionProfileName()

  Description copied from interface: `ISQLEditorConnectionInfo`
  Gets the `IConnectionProfile` name associated with this input. The `IConnectionProfile` object contains the information needed to connect to a database.

  Specified by:
    `getConnectionProfileName` in interface `ISQLEditorConnectionInfo`
  Overrides:
    `getConnectionProfileName` in class `SQLEditorConnectionInfo`
  Returns:
    the `IConnectionProfile` name associated with this input or `null` if none

### getDatabase

    public Database getDatabase()

  Description copied from interface: `ISQLEditorConnectionInfo`
  Gets the `Database` object associated with this input. The `Database` object provides access to database metadata (catalog) information.

  Specified by:
    `getDatabase` in interface `ISQLEditorConnectionInfo`
  Overrides:
    `getDatabase` in class `SQLEditorConnectionInfo`
  Returns:
    the `Database` object associated with this input, or `null` if none

### getSharedConnection

    public java.sql.Connection getSharedConnection()

  Retrieves the sharable connection from IControlConnection, which in turn delegates to the connectivity layer.

  Specified by:
    `getSharedConnection` in interface `ISQLEditorConnectionInfo`
  Overrides:
    `getSharedConnection` in class `SQLEditorConnectionInfo`
  Returns:
    if no shared connection set, return null.

### encode

    public java.lang.String encode()

  Encodes the given `SQLBuilderConnectionInfo` object for persistence

  Specified by:
    `encode` in interface `ISQLEditorConnectionInfo`
  Overrides:
    `encode` in class `SQLEditorConnectionInfo`
  Parameters:
    `info` -
  Returns:
    A encoded String
  See Also:
    `decode()`