Example data source
- Last Updated: August 29, 2024
- 1 minute read
- DataDirect Connectors
- JDBC
- Microsoft Sharepoint 6.0
- Documentation
To configure a data source using the example files, you will need to create a data source definition. The content required to create a data source definition is divided into three sections.
First, you will need to import the data source class. For example:
import com.ddtek.jdbcx.sharepoint.SharePointDataSource;
Next, you will need to set the values and define the data source. For example, the following definition contains the minimum properties required for a connection using the OAuth 2.0 refresh token grant.
setProxyPassword("secret").SharePointDataSource mds = new SharePointDataSource();
mds.setDescription("My SharePoint Data Source");
mds.setServiceURL("https://mycorp.sharepoint.com/sites/marketing/global");
mds.ClientID("29453d6f-6789-25gh-gd8g-44tk3c527831");
mds.ClientSecret("12a3=bCD/EfGh4Ijk+Lm5P67qR8s=//TuV+WXy1Zabcd");
mds.TokenURI("https://login.microsoftonline.com/common/oauth2/v2.0/token");
mds.RefreshToken("12a3=bCD/EfGh4Ijk+Lgd8g-44tk3c527831");
Finally, you will need to configure the example application to print out the data source attributes. Note that this code is specific to the driver and should only be used in the example application. For example, you would add the following section for the minimum properties required to establish a connection:
if (ds instanceof SharePointDataSource)
{
SharePointDataSource jmds = (SharePointDataSource) ds;
System.out.println("description=" + jmds.getDescription());
System.out.println("serviceurl=" + jmds.getServiceURL());
...
System.out.println();
}