use of software.amazon.awssdk.services.redshiftdata.RedshiftDataClient in project aws-doc-sdk-examples by awsdocs.
the class InsertData method getClient.
private static RedshiftDataClient getClient() {
Region region = Region.US_WEST_2;
RedshiftDataClient redshiftDataClient = RedshiftDataClient.builder().region(region).build();
return redshiftDataClient;
}
use of software.amazon.awssdk.services.redshiftdata.RedshiftDataClient in project aws-doc-sdk-examples by awsdocs.
the class ListDatabases method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " ListDatabases <database> <dbUser> <sqlStatement> <clusterId> \n\n" + "Where:\n" + " database - the name of the database (for example, dev) \n" + " dbUser - the master user name \n" + " clusterId - the id of the Redshift cluster (for example, redshift-cluster) \n";
if (args.length != 3) {
System.out.println(USAGE);
System.exit(1);
}
String database = args[0];
String dbUser = args[1];
String clusterId = args[2];
Region region = Region.US_WEST_2;
RedshiftDataClient redshiftDataClient = RedshiftDataClient.builder().region(region).build();
listAllDatabases(redshiftDataClient, clusterId, dbUser, database);
listAllTables(redshiftDataClient, clusterId, dbUser, database);
redshiftDataClient.close();
}
Aggregations