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

Bearer Token authentication

Connection conn = DriverManager.getConnection
 ("jdbc:datadirect:teamcity:ServerName=https://teamcity.company.com;
   AuthenticationMethod=BearerToken;SecurityToken=12a3=bCD/4tk3c527831;");
Note: See Bearer token authentication for details.