JBoss.orgCommunity Documentation
In Teiid a connector handles all communications with individual enterprise information sources, which can include databases, data feeds, flat files, or any other entity you have modeled.
In Teiid, a connector is used to:
Translate a Teiid-specific command into a native command.
Execute the command.
Return batches of results to Teiid.
Teiid is responsible for reassembling the results from one or more connectors into an answer for the user’s command.
For a more detailed workflow, see the chapter “Connector API.”
Teiid can provide several connectors for common enterprise information system types. If you can use one of these enterprise information systems, you do not need to develop a custom one.
Teiid offers the following connectors:
JDBC: Connects to many relational databases. The JDBC Connector is validated against the following database systems: Oracle, Microsoft SQL Server, IBM DB2, MySQL, Postgres, Derby, and Sybase. In addition, the JDBC Connector can often be used with other 3rd-party drivers and provides a wide range of extensibility options to specialize behavior against those drivers.
Text: Connects to text files.
XML Connects to XML files on disk or by invoking Web services on other enterprise systems.
LDAP Connects to LDAP directory services.
Salesforce Connects to Salesforce.
To write a connector, follow this procedure:
Gather all necessary information about your Enterprise Information System (EIS). You will need to know:
API for accessing the system
Configuration and connection information for the system
Expectation for incoming queries/metadata
The SQL and processing constructs supported by information system.
Required properties for the connector, such as URL, user name, etc.
The CDK development kit (jars and tools).
Implement the required interfaces defined by the Connector API.
Connector – starting point.
Connection – represents a connection to the source.
ConnectorCapabilities – specifies what kinds of commands your connector can execute
Execution (and sub-interfaces) – specifies how to execute each type of command
Test your connector with Connector Development Kit (CDK) test utilities.
Deploy your connector type into Teiid.
Create and import your connector type definition file.
Create a connector binding using the connector type
Deploy a Virtual Database with metadata corresponding to your EIS
Execute queries via Teiid.
This guide covers how to do each of these steps in detail. It also provides additional information for advanced topics, such as connection pooling, streaming large objects, and transactions. For a sample connector code, please check the Teiid community