Passing the connection URL
- Last Updated: April 19, 2022
- 1 minute read
- DataDirect Connectors
- JDBC
- Autonomous REST Connector 6.0
- Documentation
After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL. The form of the connection URL differs depending on whether you are using a Model file.
Connection URL Syntax
For sessions using a Model file (sessions that use multiple endpoints, POST requests, or other customizations supported by the Model file):
("jdbc:datadirect:autorest://servername;Config=model_file_path;[property=value[;...]];")
For sessions using the Sample property:
("jdbc:datadirect:autorest:Sample=sample_path;[property=value[;...]];")
where:
- servername
- optionally, specifies the host name portion of the HTTP endpoint to which you send requests. Specify this value only if you want to define endpoints without the web server address in the REST config file.
- model_file_path
- specifies the name and location of the Model file that contains a list of endpoints to sample, PUSH request definitions, and configuration information. See "Creating a Model file" for details.
- property=value
- specifies connection property settings. Multiple properties are separated by a semi-colon.
- sample_path
- specifies the endpoint the sample when not using a Model file.
Connection URL Example
For sessions using a Model file:
Connection conn = DriverManager.getConnection
("jdbc:datadirect:autorest:https://example.com/;Config=C:\path\to\myrest.rest;");
For sessions using the Sample property:
Connection conn = DriverManager.getConnection
("jdbc:datadirect:autorest:Sample='https://example.com//countries/get/all';");