User guide
4. At the psql password prompt, enter the password for the <userid> user.
You are connected to the cluster, and you can interactively enter commands.
Connect to Your Cluster Programmatically
Topics
• Connecting to a Cluster by Using Java (p. 169)
• Connecting to a Cluster by Using .NET (p. 171)
This section explains how to connect to your cluster programmatically. If you are using an application like
SQL Workbench/J that manages your client connections for you, then you can skip this section.
Connecting to a Cluster by Using Java
When you use Java to programmatically connect to your cluster, you can do so with or without server
authentication. If you plan to use server authentication, follow the instructions in Configure Security Options
for Connections (p. ?) to put the Amazon Redshift server certificate into a keystore.You can refer to the
keystore by specifying a property when you run your code as follows:
-Djavax.net.ssl.trustStore=<path to keystore>
-Djavax.net.ssl.trustStorePassword=<keystore password>
API Version 2012-12-01
169
Amazon Redshift Management Guide
Connecting to Clusters From Client Tools and Code