Passing the connection URL
- Last Updated: May 13, 2025
- 1 minute read
- DataDirect Connectors
- JDBC
- Documentation
After registering the driver, the required connection information needs to be passed in the form of a connection URL. The connection URL takes the form:
Connection conn = DriverManager.getConnection
(jdbc:datadirect:redshift://servername:port;[property=value[;...]];)
where:
- servername
- specifies the name or the IP address of the server to which you want to connect.
- port
- specifies the port number of the server listener. The default is
5439.
- property
=value - specifies connection property settings. Multiple properties are separated by a semi-colon. For more information on connection properties, see "Using Connection Properties."
This example shows how to establish a connection to an Amazon Redshift database with user ID/password authentication:
Connection conn = DriverManager.getConnection
("jdbc:datadirect:redshift://Server3:5439;
DatabaseName=Test;User=admin;Password=adminpass");