JBoss.orgCommunity Documentation
In the Teiid System, a connector handles all request-and-response related communications between the data tier of the Teiid Server and the individual enterprise information sources, which can include databases, data feeds, flat files, or any other entity you have modeled
In the Teiid Server, a connector is used to:
Translate a Teiid-specific command into a native command.
Execute the command.
Return batches of results to the Teiid Server.
The Teiid Server 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. Instead, you can contact your Teiid Technical Account Manager and ask about purchasing the connector you need.
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 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 ASCII text files.
XML Connects to XML files on disk or by invoking Web services on other enterprise systems.
If your enterprise information system can use one of these connectors, you do not need to develop your own. Instead, you can contact Teiid about acquiring the connector you need.
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
Metadata
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 a Teiid Server using the Teiid Console.
Create your connector type definition file. Import the 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 the Teiid JDBC API or QueryBuilder
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 wiki pages at Teiid community