EasyManuals Logo

Amazon Redshift User Manual

Amazon Redshift
131 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #123 background imageLoading...
Page #123 background image
c. In the bin folder of your working directory, create a AwsCredentials.properties file, as shown
in the following example:
#Insert your AWS Credentials from http://aws.amazon.com/security-credentials
secretKey=*** Your Account Secret Access Key***
accessKey=***Your Account Access Key ID***
d. Ensure that you can run the Java program compiler (javac) and the Java application launcher
(java) from your working directory.You can test by running the following commands:
javac -help
java -help
2. Put the code that you want to run in a .java file, and save the file in the src folder. To illustrate the
process, we use the code from Managing Security Groups Using AWS SDK for Java (p. 37) so that
the file in the src directory is CreateAndModifyClusterSecurityGroup.java.
3. Compile the code.
javac -cp sdk/lib/aws-java-sdk-1.3.18.jar -d bin src\CreateAndModifyCluster
SecurityGroup.java
If you are using a different version of the AWS SDK for Java, adjust the classpath (-cp) for your version.
4. Run the code. In the following command, line breaks are added for readability.
java -cp "bin;
sdk/lib/*;
sdk/third-party/commons-logging-1.1.1/*;
sdk/third-party/httpcomponents-client-4.1.1/*;
sdk/third-party/jackson-core-1.8/*"
CreateAndModifyClusterSecurityGroup
Change the class path separator as needed for your operating system. For example, for Windows, the
separator is ";" (as shown), and for Unix, it is ":". Other code examples may require more libraries than
are shown in this example, or the version of the AWS SDK you are working with may have different
third-party folder names. For these cases, adjust the classpath (-cp) as appropriate.
To run samples in this document, use a version of the AWS SDK that supports Amazon Redshift.To
get the latest version of the AWS SDK for Java, go to AWS SDK for Java.
Setting the Endpoint
By default, the AWS SDK for Java uses the endpoint https://redshift.us-east-1.amazonaws.com/.
You can set the endpoint explicitly with the client.setEndpoint method as shown in the following
Java code snippet.
client = new AmazonRedshiftClient(credentials);
client.setEndpoint("https://redshift.us-east-1.amazonaws.com/");
For a list of supported AWS regions where you can provision a cluster, go to the Regions and Endpoints
section in the Amazon Web Services Glossary.
API Version 2012-12-01
119
Amazon Redshift Management Guide
Setting the Endpoint

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Amazon Redshift and is the answer not in the manual?

Amazon Redshift Specifications

General IconGeneral
ProviderAmazon Web Services (AWS)
Query LanguageSQL
Data StorageColumnar storage
SecurityEncryption at rest and in transit, VPC, IAM
BackupAutomated and manual snapshots
DeploymentCloud-based
TypeCloud-based data warehouse service
Primary UseData warehousing, analytics
IntegrationIntegrates with AWS services, BI tools, and ETL tools
Pricing ModelOn-demand and reserved instance pricing
Data CompressionColumnar storage with data compression
Performance OptimizationQuery optimization

Related product manuals