Skip to content

Latest commit

 

History

History
70 lines (45 loc) · 2.85 KB

File metadata and controls

70 lines (45 loc) · 2.85 KB

What is it?

ldap-as-a-datasource demonstrates using the ldap Translator to access data in OpenLDAP Server.

System requirements

Setup and Deployment

1. Start the server

To start the server, open a command line and navigate to the "bin" directory under the root directory of the Teiid server and run:

./standalone.sh //For Linux
standalone.bat //for Windows

If Teiid isn’t configured in the default configuration, append the following arguments to the command to specify the configuration -c {configuration.file}

Example
./standalone.sh -c standalone-teiid.xml

2. Setup LDAP Group and Users

For installing OpenLDAP on Red Hat Linux 6.x please refer to Steps for adding Group and Users , in this section we will create a Group HR and 3 users(hr1, hr2, hr3) under it.

3. Install the ldap datasource to be referenced by the Teiid VDB

run the following CLI script

cd $JBOSS_HOME/bin
./jboss-cli.sh --connect --file={path}/ldap-as-a-datasource/src/scripts/setup.cli

NOTE - Before executing setup.cli, either modify setup.cli change {ldap.url} to LDAP url, {ldap.rootdn} to LDAP root Distinguished Name and {ldap.rootpw} to LDAP root password, or set System Properties ldap.url point to LDAP url, ldap.rootdn point to LDAP root Distinguished Name and ldap.rootpw to LDAP root password.

4. VDB Deployment

Copy the following files to the "/standalone/deployments" directory

src/vdb/ldap-vdb.xml
src/vdb/ldap-vdb.xml.dodeploy

Open the admin console(http://localhost:9990/console) to make sure the VDB is deployed. See Query Demonstrations below to demonstrate query.

Query Demonstrations

Using the simpleclient example

  1. Change your working directory to "${quickstart.install.dir}/simpleclient"

  2. Use the simpleclient example to run the following queries:

Example: mvn exec:java -Dvdb="ldapVDB" -Dsql="select * from HR_Group"

Note
depending on your OS/Shell the quoting/escaping required to run the example can be complicated. It would be better to install a Java client, such as SQuirreL, to run the queries.