During development of the 8.2 version of Designer, it came to mind that the client runtime plugins were under-utilised.
Designer 8.2 includes 3 distinct versions of the teiid client:
- Teiid 7.7 for connection to Teiid 7.x Servers, installed on JBoss 5;
- Teiid 8.3 for connection to Teiid 8.0 - 8.3 Servers;
- Teiid 8.4 for connection to Teiid 8.4 Servers.
However, until Designer 8.2 development, provision for the JDBC Teiid Driver was actually made using the default connected Teiid Server. In retrospect, this seems crazy given the inclusion of 3 Teiid clients but the organic nature of code development does tend to spring up such anomalies. Connecting to a server is not a pre-requisite for quering an external server so the JDBC connection manager, in Designer, has been modified to:
- determine the version of the Teiid Server from the connection profile;
- fetch the most appropriate local Teiid Driver from the Teiid client plugins.
Configuring Drivers the DTP Way
Eclipse provides the Data Tools Platform for providing JDBC drivers for use in the IDE. Specifically, for any driver a template, wizard and an optional default configuration instance can be provided. Designer already took advantage of this framework by providing a single default Teiid Driver template and default instance. However, as with many driver configurations, the relevent driver jar libraries must be provider (by the user) in the configuration to allow the connection to work. So two problems:
- There is only a single default Teiid Driver configuration instance provided;
- The user must provide an external jar to allow for the Teiid Driver to work correctly.
Addressing the first problem has been fairly straightforward. By simply pushing the logic and Eclipse extension configuration into each of the client plugins, Designer's driver provisioning looks like this:
The second problem is certainly tedious for the user and there is absolutely no need for it since the Teiid Driver is available in each of the 3 client plugins. Thus, in the same manner as Eclipse provides the Derby JDBC drivers, the jar list for these Teiid Driver configuration instances are auto-populated with the correct jar, which is in fact the client plugin itself.
As this example illustrates, the 7.7 client driver is provided directly by the 7.7 client plugin.
The Result
The point of this is demonstrated when switching to the 'Database Development' perspective and begin to do some SQL querying. First, the creation of the database connection is required so
- Select Database Connections and click on New... in the Database Explorer View
- Select the Teiid category on the first wizard page, provide an appropriate name and click Next>
The following wizard page is displayed:
- The drop-down box defines which driver version to employ;
- The VDB name, user and password can all be defined for connection to the specific Teiid VDB, auto-building the connection url.
On completion of the wizard a new database connection is created and can be queried with the SQL scrapbook. Indeed connections to different servers sporting different versions of Teiid can be defined:
- Teiid connections to an 8.4 and 7.7 Teiid Server;
- SQL Scrapbook opened for the 7.7 Teiid Server connection with the Teiid 7.7 driver being utilised.
Comments