One way to connect to a service is through the JDBC DriverManager using the DriverManager.getConnection() method. As the following example shows, this method specifies a string containing a connection URL.

Connection conn = DriverManager.getConnection
  ("jdbc:datadirect:sharepoint:
    ServiceURL=https://mycorp.sharepoint.com/sites/marketing/global;
    ClientID=29453d6f-6789-25gh-gd8g-44tk3c527831;
    ClientSecret=12a3=bCD/EfGh4Ijk+Lm5P67qR8s=//TuV+WXy1Zabcd;
    TokenURI=https://login.microsoftonline.com/common/oauth2/v2.0/token;
    RefreshToken=12a3=bCD/EfGh4Ijk+Lgd8g-44tk3c527831;");