skip to main content
Quick Start: Accessing REST data sources using URL parameter authentication : Connecting to a DataSource : Connecting using the DriverManager
  

Try DataDirect Drivers Now

Connecting using the DriverManager

One way to connect to a REST API data source 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:restful:AuthenticationMethod=UrlParameter;AuthParam=apikey;
Config=C:/path/to/mysite.rest;SecurityToken=XaBARTsLZReM;User=jsmith;Password=secret;");
* Passing the connection URL
* Testing a DriverManager connection