# Database Recognition

###### Identifier:

org.eclipse.datatools.connectivity.sqm.core.databaseRecognition

###### Since:

0.7

###### Description:

Provides a database recognizer. The database recognizer instance, which must implement `org.eclipse.datatools.connectivity.sqm.core.definition.IDatabaseRecognizer`, can be used for determining the `org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition` instance that is appropriate for a given `java.sql.Connection` object.

###### Configuration Markup:

<!ELEMENT extension (recognizer+ , dbDefinitionMapping*)>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED>

<!ELEMENT recognizer EMPTY>

<!ATTLIST recognizer

class CDATA #REQUIRED

name CDATA #IMPLIED>

- class - The fully qualified name of a class that implements org.eclipse.datatools.connectivity.sqm.core.definition.IDatabaseRecognizer.
- name - Arbitrary name for the recognizer.

<!ELEMENT dbDefinitionMapping EMPTY>

<!ATTLIST dbDefinitionMapping

jdbcDatabaseProductName CDATA #IMPLIED

jdbcDatabaseProductVersion CDATA #REQUIRED

dbdefinitionProduct CDATA #REQUIRED

dbdefinitionVersion CDATA #REQUIRED>

Specifies the mapping to look up the product and version of a `org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition` instance, given the database product meta-data provided by a JDBC driver. The specialized database recognizer contributed in this extension would first try to determine the appropriate DatabaseDefinition instance. If it is not able to find a match, these mappings will then get used to determine an appropriate DatabaseDefinition instance.

- jdbcDatabaseProductName - The name of a database product, as specified by a JDBC driver in its implementation of the java.sql.DatabaseMetaData#getDatabaseProductName method. This attribute value may either be the exact name to compare to (ignoring case), or a RegEx pattern to match the value returned by the #getDatabaseProductName method.
- jdbcDatabaseProductVersion - The version number of a database product, as specified by a JDBC driver in its implementation of the java.sql.DatabaseMetaData#getDatabaseProductVersion method. This attribute value may either be the exact name to compare to (ignoring case), or a RegEx pattern to match the value returned by the #getDatabaseProductVersion method.
- dbdefinitionProduct - The vendor or product name specified in an extension of the org.eclipse.datatools.connectivity.sqm.core.databaseDefinition extension point. The value must reference the definition.product attribute in a databaseDefinition extension.
- dbdefinitionVersion - The version name specified in an extension of the org.eclipse.datatools.connectivity.sqm.core.databaseDefinition extension point. The value must reference the definition.version attribute in a databaseDefinition extension.

###### API Information:

Use the `org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinitionRegistry#recognize(Connection)` method to exercise the functionality provided by this extension point.

Copyright 2005, 2009 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html