Passing the connection URL
- Last Updated: November 15, 2021
- 1 minute read
- DataDirect Connectors
- JDBC
- Amazon Redshift 6.0
- Documentation
After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL. The following example includes the properties required for connecting with UserID/Password authentication.
Connection URL Syntax
The connection URL takes the following form:
jdbc:datadirect:redshift://server_name:port_number;DatabaseName=database_name;
UserName=user_name;Password=password;[property=value[;...]];
where:
- server_name
- specifies either the IP address or the server name of the primary database server.
- port_number
- specifies the TCP port of the primary database server that is listening for connections to the database.
- database_name
- specifies the name of the database to which you want to connect.
- user_name
- Specifies the user ID used to authenticate to Redshift with UserID/Password authentication method.
- password
- Specifies the password used to authenticate to Redshift with UserID/Password authentication method.
- property=value
- specifies connection property settings. Multiple properties are separated by a semi-colon.
The following example connection string includes the properties required for connecting with the UserID/Password authentication.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:redshift://MyServer:5439;DatabaseName=MyDB;
UserName=JSmith;Password=secret");