JDBC Driver for Microsoft Active Directory

Build 22.0.8462

Establishing a Connection

Creating a JDBC Data Source

You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for Microsoft Active Directory consists of three basic steps:

  • Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
  • Provide the driver class. For example:
    cdata.jdbc.activedirectory.ActiveDirectoryDriver
  • Provide the JDBC URL. For example:
    jdbc:activedirectory:User=MyUserName;Password=MyPassword;Server=MyServer;Port=MyPort;
    
    or
    
    jdbc:cdata:activedirectory:User=MyUserName;Password=MyPassword;Server=MyServer;Port=MyPort;

    The second format above can be used whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:activedirectory:" or "jdbc:cdata:activedirectory:" and can include any of the connection properties in name-value pairs separated with semicolons.

Connecting to Microsoft Active Directory

Set Server and Port for basic connectivity. Additionally, you can fine-tune the connection with the following:

  • FollowReferrals: When set, the driver surfaces data as views from only referral servers. To modify data on a referral server, you must specify this server with Server and Port.
  • LDAPVersion: Set this to the version of the protocol your server implements; by default, the driver uses version 2.

Authenticating to Microsoft Active Directory

To authenticate requests, set the User and Password properties to valid Microsoft Active Directory credentials (e.g., set User to Domain\\BobF or cn=Bob F,ou=Employees,dc=Domain).

The driver uses plaintext authentication by default, since the driver attempts to negotiate TLS/SSL with the server. You can specify another authentication method with AuthMechanism.

See SSL Configuration for more information on TLS/SSL configuration.

Fine Tuning Data Access

The following properties control the scope of data returned:

  • BaseDN will limit the scope of LDAP searches to the height of the distinguished name provided. Note: Specifying a narrow BaseDN may greatly increase performance; for example, a value of cn=users,dc=domain will only return results contained within cn=users and its children.
  • Scope: This property enables more granular control over the data to return from a subtree.

Customizing Tables

The driver surfaces the columns most often needed from Microsoft Active Directory entities. However, if you need to work with other data, the tables are easy to modify. Tables are defined in schema files, which have a simple format.

See Working with Active Directory Tables for a guide to extending the default schemas or writing your own. To use custom schemas, set the Location property to the folder containing the schema files.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462