System.out.println(", Name: " + name);
}
rs.close();
stmt.close();
conn.close();
}catch(Exception ex){
//For convenience, handle all errors here.
ex.printStackTrace();
}finally{
//Finally block to close resources.
try{
if(stmt!=null)
stmt.close();
}catch(Exception ex){
}// nothing we can do
try{
if(conn!=null)
conn.close();
}catch(Exception ex){
ex.printStackTrace();
}
}
System.out.println("Finished connectivity test.");
}
}
Connecting to a Cluster by Using .NET
When you use .NET (C#) 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
Connect to Your Cluster
Using SSL (p. ?)
to download the Amazon Redshift server certificate, and then put the certificate in the
correct form for your .NET code.
API Version 2012-12-01
110
Amazon Redshift Management Guide
Connecting to a Cluster by Using .NET