Teiid embedded samples OpenLDAP

Teiid Embedded is a light-weight version of Teiid, it contain an easy-to-use JDBC Driver that can embed the Query Engine in any Java application. The Embedded mode supply almost all Teiid features without JEE Container involved, it supply a convenient way for Users who want integrate Teiid with their Application.

This document show how Teiid Embedded use OpenLDAP as data source, the architecture as below:



Java on top of LDAP including OpenLDAP install, configure, etc. It also have example Groupd HR have 3 Users under it, This article use that example Group.


A Virtual Database (VDB) is an artifact that defines the logical schema model combining one or more physical data sources to provide easy data integration. In this example, ldapVDB VDB has Model HRModel point to OpenLDAP.

The completed content of HRModel VDB


Java Application run on JVM, load the HRModel VDB and query via JDBC. The mainly Code Snippets:

init("translator-mongodb", new LDAPExecutionFactory());
LDAPManagedConnectionFactory managedconnectionFactory = new LDAPManagedConnectionFactory();
server.addConnectionFactory("java:/ldapDS", managedconnectionFactory.createConnectionFactory());
server.deployVDB(new FileInputStream(new File("vdb/ldap-vdb.xml")));
conn = server.getDriver().connect("jdbc:teiid:ldapVDB", null);

Completed Source code