Search in sources :

Example 6 with RedshiftDataClient

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;
}
Also used : RedshiftDataClient(software.amazon.awssdk.services.redshiftdata.RedshiftDataClient) Region(software.amazon.awssdk.regions.Region)

Example 7 with 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();
}
Also used : RedshiftDataClient(software.amazon.awssdk.services.redshiftdata.RedshiftDataClient) Region(software.amazon.awssdk.regions.Region)

Aggregations

RedshiftDataClient (software.amazon.awssdk.services.redshiftdata.RedshiftDataClient)7 Region (software.amazon.awssdk.regions.Region)4 ParseException (java.text.ParseException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 LocalDateTime (java.time.LocalDateTime)2 DateTimeFormatter (java.time.format.DateTimeFormatter)2 Date (java.util.Date)2 UUID (java.util.UUID)2