Reputation: 1198
I'm trying to do SQL query on redshift database without using JDBC. (I don't want to connect to JDBC to execute a SQL command in the redshift as shown in this link: https://docs.aws.amazon.com/redshift/latest/mgmt/connecting-in-code.html).
I'm connecting AmazonRedshift using redshift client builder
AmazonRedshift client = AmazonRedshiftClientBuilder.standard()
.withCredentials(awsCredentials).build();
Now I want to execute a SQL query using this client. I googled and found this example (https://docs.aws.amazon.com/redshift/latest/mgmt/managing-events-java.html) where they are using DescribeEventsRequest to get the events but I'm not sure whether this is the same API I should use to run SQL commands
Thanks in advance
Upvotes: 0
Views: 1192
Reputation: 36073
The AWS SDK (AmazonRedshift
client), can only be used to manage the Redshift cluster (create, delete, manage events, etc.) It cannot be used to execute queries.
To execute queries, you must use JDBC.
Upvotes: 2