JDBC Driver for SharePoint

Build 20.0.7655

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 SharePoint 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:
  • Provide the JDBC URL. For example:
    jdbc:sharepoint:User=MyUserAccount;Password=MyPassword;Auth Scheme=NTLM;URL=http://sharepointserver/mysite;
    jdbc:cdata:sharepoint:User=MyUserAccount;Password=MyPassword;Auth Scheme=NTLM;URL=http://sharepointserver/mysite;

    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:sharepoint:" or "jdbc:cdata:sharepoint:" and can include any of the connection properties in name-value pairs separated with semicolons.

Connecting to SharePoint

Set the URL to a Site Collection to work with all Lists and Documents in the global Sharepoint site. Set the URL to a specific Site to work with Lists and Documents in that Site only.

URLExample URL
Sitehttps://teams.contoso.com/teamA or https://teamA.contoso.com
Site Collectionhttps://teams.contoso.com

In addition to providing the URL, use one of the following sets of connection properties to authenticate to SharePoint. The default values make it easy to connect in most environments, as shown below.

Authenticating to SharePoint Online

Set SharePointEdition to "SharePoint Online" and set the User and Password to the credentials you use to log onto SharePoint; for example, the credentials to your Microsoft Online Services account.

The following SSO (single sign-on) identity providers are also supported: Azure Active Directory, OneLogin, and OKTA.

  • SSO

    If you have enabled SSO in SharePoint Online, set UseSSO to true in addition to your User and Password.

    If the user account domain is different from the domain configured with the identity provider, set SSODomain to the domain configured with the identity provider. This property may be required for AD FS, OneLogin, and OKTA.

Authenticating to SharePoint On Premises

Set SharePointEdition to "SharePoint OnPremise" to use the following authentication types.

  • Windows (NTLM)

    This is the most common authentication type. As such, the driver is preconfigured to use NTLM as the default; simply set the Windows User and Password to connect.

  • Kerberos and Kerberos Delegation

    To authenticate with Kerberos, set AuthScheme to NEGOTIATE. If needed, provide the User and Password. To use Kerberos Delegation, set AuthScheme to KERBEROSDELEGATION.

    KerberosKDC, KerberosSPN, and KerberosRealm enable control over the components of Kerberos authentication.

  • Forms

    This allows authentication through a custom authentication method, instead of Active Directory. To use this authentication type, set AuthScheme to FORMS and set the User and Password.

Authenticating using MSI Authentication

If you are running SharePoint on an Azure VM, you can leverage Managed Service Identity (MSI) credentials to connect:

  • AuthScheme: Set this to AzureMSI.

The MSI credentials will then be automatically obtained for authentication.

Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 20.0.7655