## org.eclipse.datatools.sqltools.core
Class SQLToolsFacade

    java.lang.Object
      org.eclipse.datatools.sqltools.core.SQLToolsFacade

    public class SQLToolsFacade

extends java.lang.Object

This should be the central place to query about contributed `SQLDevToolsConfiguration`s. Unlike `SQLDevToolsConfigRegistry`, the default `SQLDevToolsConfiguration` will be used if no registered `SQLDevToolsConfiguration`.

Author:
  Hui Cao

Method Summary
`static java.util.Collection` `getAllAvailableDBDefinitionIds()` Returns all the database definition names which can be used in SQL Dev Tools.
`static java.util.Collection` `getAllAvailableDBDefinitionNames()`
`static DatabaseVendorDefinitionId` `getCanonicalDatabaseVendorDefinitionId(DatabaseVendorDefinitionId vendorId)` Returns the canonical DatabaseVendorDefinitionId referenced by the corresponding SQLDevToolsConfiguration.
`static SQLDevToolsConfiguration` `getConfiguration(DatabaseIdentifier databaseIdentifier, DatabaseVendorDefinitionId vendorId)` Gets the `SQLDevToolsConfiguration` object.
`static SQLDevToolsConfiguration` `getConfiguration(java.lang.String dbType, DatabaseIdentifier databaseIdentifier)`
`static SQLDevToolsConfiguration` `getConfigurationByDBDefName(java.lang.String dbDefName)` Gets the `SQLDevToolsConfiguration` object by the database definition name.
`static SQLDevToolsConfiguration` `getConfigurationByProfileName(java.lang.String profileName)` Gets the `SQLDevToolsConfiguration` object by the connection profile name.
`static SQLDevToolsConfiguration` `getConfigurationByVendorIdentifier(DatabaseVendorDefinitionId vendorId)` Gets the `SQLDevToolsConfiguration` object by the `DatabaseVendorDefinitionId` object
`static java.util.Collection` `getConfigurations()` Gets all the contributed database factories
`static java.util.Collection` `getConnectibleDBDefinitionNames()` Returns the registered database definition names which are declared as connectible.
`static int` `getConnectionId(DatabaseIdentifier databaseIdentifier, java.sql.Connection conn)`
`static IConnectionInitializer` `getConnectionInitializer(DatabaseIdentifier databaseIdentifier)`
`static java.lang.Runnable` `getConnectionKiller(DatabaseIdentifier databaseIdentifier, java.sql.Connection conn)`
`static ConnectionService` `getConnectionService(DatabaseIdentifier databaseIdentifier)`
`static IDatabaseSetting` `getDatabaseSetting(DatabaseIdentifier databaseIdentifier)`
`static DBHelper` `getDBHelper(DatabaseIdentifier databaseIdentifier)`
`static DBHelper` `getDBHelper(DatabaseIdentifier databaseIdentifier, java.lang.String dbType)`
`static DBHelper` `getDBHelper(java.lang.String dbType)`
`static int[]` `getDBTypes()`
`static DatabaseVendorDefinitionId` `getDeclaredDatabaseVendorDefinitionId(DatabaseVendorDefinitionId vendorId)` Returns the declared DatabaseVendorDefinitionId matching the given parameter.
`static SQLDevToolsConfiguration` `getDefaultConfiguration()` Gets the default `SQLDevToolsConfiguration` object, which is contributed via the "isDefault" attribute of the "dbConfiguration" extension point, or if there's no such contribution, will use SQLDevToolsConfiguration.getDefaultInstance().
`static DatabaseVendorDefinitionId` `getDefaultDatabaseVendorDefinitionId()` Returns the DatabaseVendorDefinitionId which contributes to the sql dev tools framework as a default configuration.
`static SQLToolsFacade` `getInstance()` Singleton
`static DatabaseVendorDefinitionId` `getNonSpecificDatabaseVendorDefinitionId()` Returns the DatabaseVendorDefinitionId which is not bind to any database
`static java.util.Collection` `getPlanOptions()` Return all the available plan options
`static IPlanService` `getPlanService(DatabaseIdentifier databaseIdentifier)` Returns a database-specific query plan service class.
`static GenericSQLContextType` `getSQLContextType(java.lang.String dbType)` Return a specific GenericSQLContextType object which identifies the context type of templates used in SQL editor.
`static java.util.Collection` `getSQLContextTypes()` Return all the GenericSQLContextType objects which identify the context type of templates used in SQL editor.
`static SQLDataService` `getSQLDataService(DatabaseIdentifier databaseIdentifier, java.lang.String dbType)` Returns a database-specific SQL Data service class.
`static ISqlDataValidator` `getSQLDataValidator(DatabaseIdentifier databaseIdentifier)` Return a special SQLDataValidator to verify user's input value
`static SQLEditorService` `getSQLEditorService(DatabaseIdentifier databaseIdentifier, java.lang.String dbType)` Returns a database-specific SQL statement service class.
`static SQLParser` `getSQLParser(java.lang.String profileName, java.lang.String dbType)` Return a SQLParser which is used to parse database dialect
`static SQLService` `getSQLService(DatabaseIdentifier databaseIdentifier, java.lang.String dbType)` Returns a database-specific SQL statement service class.
`static ISQLSyntax` `getSQLSyntax(java.lang.String dbType)` Return an ISQLSyntax object which can be used to highlight sql statements in SQL editor.
`static java.util.Collection` `getSupportedDBDefinitionNames()` Returns the database definition names which has associated `SQLDevToolsConfiguration`s.
`static DatabaseVendorDefinitionId` `recognize(java.lang.String product, java.lang.String version)` Returns a DatabaseVendorDefinitionId matching the product and version.
`static boolean` `showAction(java.lang.String dbType, java.lang.String actionId)`

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

Method Detail

### getInstance

    public static SQLToolsFacade getInstance()

  Singleton

  Returns:

### getConfigurations

    public static java.util.Collection getConfigurations()

  Gets all the contributed database factories

  Returns:

### getSupportedDBDefinitionNames

    public static java.util.Collection getSupportedDBDefinitionNames()

  Returns the database definition names which has associated `SQLDevToolsConfiguration`s.

  Returns:
    Full database definition names including product name and version

### getConnectibleDBDefinitionNames

    public static java.util.Collection getConnectibleDBDefinitionNames()

  Returns the registered database definition names which are declared as connectible.

  Returns:
    Full database definition names including product name and version

### getAllAvailableDBDefinitionIds

    public static java.util.Collection getAllAvailableDBDefinitionIds()

  Returns all the database definition names which can be used in SQL Dev Tools. This includes the combination of getSupportedDBDefinitionNames() and getConnectibleDBDefinitionNames().

  Returns:
    Full database definition names including product name and version

### getAllAvailableDBDefinitionNames

    public static java.util.Collection getAllAvailableDBDefinitionNames()

### getConfigurationByDBDefName

    public static SQLDevToolsConfiguration getConfigurationByDBDefName(java.lang.String dbDefName)

  Gets the `SQLDevToolsConfiguration` object by the database definition name.

  Parameters:
    `dbDefName` - database definition name, which is product name appended by "_" and version.
  Returns:
    `SQLDevToolsConfiguration` object

### getConfigurationByVendorIdentifier

    public static SQLDevToolsConfiguration getConfigurationByVendorIdentifier(DatabaseVendorDefinitionId vendorId)

  Gets the `SQLDevToolsConfiguration` object by the `DatabaseVendorDefinitionId` object

  Parameters:
    `id` - `DatabaseVendorDefinitionId` object represented by product name and version
  Returns:
    `SQLDevToolsConfiguration` object

### getConfigurationByProfileName

    public static SQLDevToolsConfiguration getConfigurationByProfileName(java.lang.String profileName)

  Gets the `SQLDevToolsConfiguration` object by the connection profile name. Since different versions of a database may use the same connection profile provider id, we'll compare the real version of the server with the version string declared for the `SQLDevToolsConfiguration` and finds the most suitable one.

  Parameters:
    `profileName` - connection profile name
  Returns:
    `SQLDevToolsConfiguration` object

### getConfiguration

    public static SQLDevToolsConfiguration getConfiguration(DatabaseIdentifier databaseIdentifier,
                                                            DatabaseVendorDefinitionId vendorId)

  Gets the `SQLDevToolsConfiguration` object. This is a utility method for getConfigurationByProfileName(String profileName) and getDBFactoryByDBName(String dbName). It will try to use the first parameter then the second.

  Parameters:
    `databaseIdentifier` - `DatabaseIdentifier` which contains connection profile name, can be null
    `id` - `DatabaseVendorDefinitionId` object represented by product name and version, can be null
  Returns:
    `SQLDevToolsConfiguration` object

### getCanonicalDatabaseVendorDefinitionId

    public static DatabaseVendorDefinitionId getCanonicalDatabaseVendorDefinitionId(DatabaseVendorDefinitionId vendorId)

  Returns the canonical DatabaseVendorDefinitionId referenced by the corresponding SQLDevToolsConfiguration. If no exact versions match, the latest version of the same product would be used.

  Parameters:
    `vendorId` -
  Returns:

### getDeclaredDatabaseVendorDefinitionId

    public static DatabaseVendorDefinitionId getDeclaredDatabaseVendorDefinitionId(DatabaseVendorDefinitionId vendorId)

  Returns the declared DatabaseVendorDefinitionId matching the given parameter. If none is found, the original one is returned.

  Parameters:
    `vendorId` -
  Returns:

### getDefaultConfiguration

    public static SQLDevToolsConfiguration getDefaultConfiguration()

  Gets the default `SQLDevToolsConfiguration` object, which is contributed via the "isDefault" attribute of the "dbConfiguration" extension point, or if there's no such contribution, will use SQLDevToolsConfiguration.getDefaultInstance().

  Returns:
    default `SQLDevToolsConfiguration` object. Will never be null.

### getDefaultDatabaseVendorDefinitionId

    public static DatabaseVendorDefinitionId getDefaultDatabaseVendorDefinitionId()

  Returns the DatabaseVendorDefinitionId which contributes to the sql dev tools framework as a default configuration.

  Returns:

### getNonSpecificDatabaseVendorDefinitionId

    public static DatabaseVendorDefinitionId getNonSpecificDatabaseVendorDefinitionId()

  Returns the DatabaseVendorDefinitionId which is not bind to any database

  Returns:

### recognize

    public static DatabaseVendorDefinitionId recognize(java.lang.String product,
                                                       java.lang.String version)

  Returns a DatabaseVendorDefinitionId matching the product and version. If no exact matches are found, the generic DatabaseVendorDefinitionId (Genrice_JDBC_1.x) will be returned.

  Parameters:
    `product` -
    `version` -
  Returns:

### getConnectionId

    public static int getConnectionId(DatabaseIdentifier databaseIdentifier,
                                      java.sql.Connection conn)

### getConnectionService

    public static ConnectionService getConnectionService(DatabaseIdentifier databaseIdentifier)

### getConnectionKiller

    public static java.lang.Runnable getConnectionKiller(DatabaseIdentifier databaseIdentifier,
                                                         java.sql.Connection conn)

### getDatabaseSetting

    public static IDatabaseSetting getDatabaseSetting(DatabaseIdentifier databaseIdentifier)

### getConnectionInitializer

    public static IConnectionInitializer getConnectionInitializer(DatabaseIdentifier databaseIdentifier)

### getDBHelper

    public static DBHelper getDBHelper(DatabaseIdentifier databaseIdentifier,
                                       java.lang.String dbType)

### getDBHelper

    public static DBHelper getDBHelper(DatabaseIdentifier databaseIdentifier)

  Parameters:
    `databaseIdentifier` -
  Returns:

### getDBHelper

    public static DBHelper getDBHelper(java.lang.String dbType)

  Parameters:
    `dbType` -
  Returns:

### getSQLDataService

    public static SQLDataService getSQLDataService(DatabaseIdentifier databaseIdentifier,
                                                   java.lang.String dbType)

  Returns a database-specific SQL Data service class.

  Parameters:
    `profileName` -
    `dbType` -
  Returns:

### getSQLDataValidator

    public static ISqlDataValidator getSQLDataValidator(DatabaseIdentifier databaseIdentifier)

  Return a special SQLDataValidator to verify user's input value

  Parameters:
    `profileName` -
  Returns:

### getSQLService

    public static SQLService getSQLService(DatabaseIdentifier databaseIdentifier,
                                           java.lang.String dbType)

  Returns a database-specific SQL statement service class.

  Parameters:
    `profileName` -
    `dbType` -
  Returns:

### getSQLSyntax

    public static ISQLSyntax getSQLSyntax(java.lang.String dbType)

  Return an ISQLSyntax object which can be used to highlight sql statements in SQL editor.

  Parameters:
    `dbType` -
  Returns:

### getSQLParser

    public static SQLParser getSQLParser(java.lang.String profileName,
                                         java.lang.String dbType)

  Return a SQLParser which is used to parse database dialect

  Parameters:
    `profileName` -
    `dbType` -
  Returns:

### getSQLContextType

    public static GenericSQLContextType getSQLContextType(java.lang.String dbType)

  Return a specific GenericSQLContextType object which identifies the context type of templates used in SQL editor.

  Parameters:
    `dbType` -
  Returns:

### getSQLEditorService

    public static SQLEditorService getSQLEditorService(DatabaseIdentifier databaseIdentifier,
                                                       java.lang.String dbType)

  Returns a database-specific SQL statement service class.

### getPlanService

    public static IPlanService getPlanService(DatabaseIdentifier databaseIdentifier)

  Returns a database-specific query plan service class.

### getDBTypes

    public static int[] getDBTypes()

### getSQLContextTypes

    public static java.util.Collection getSQLContextTypes()

  Return all the GenericSQLContextType objects which identify the context type of templates used in SQL editor.

  Returns:

### getPlanOptions

    public static java.util.Collection getPlanOptions()

  Return all the available plan options

  Returns:

### showAction

    public static boolean showAction(java.lang.String dbType,
                                     java.lang.String actionId)

### getConfiguration

    public static SQLDevToolsConfiguration getConfiguration(java.lang.String dbType,
                                                            DatabaseIdentifier databaseIdentifier)

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