Is it possible to fire a copy command from S3 To Redshift through java jdbc connection?
Example: copy test from 's3://' CREDENTIALS 'aws_access_key_id=xxxxxxx;aws_secret_access_key=xxxxxxxxx'
Is it possible to fire a copy command from S3 To Redshift through java jdbc connection?
Example: copy test from 's3://' CREDENTIALS 'aws_access_key_id=xxxxxxx;aws_secret_access_key=xxxxxxxxx'
Sandesh's answer works perfectly fine, but it uses PostgreSql driver. AWS Provides Redshift driver, which is better than PostgreSql driver. Rest of things would remain same. I hope this information may help others.
1)JDBC Driver will change from
org.postgresql.Driver
tocom.amazon.redshift.jdbcXX.Driver
, where XX is the version of Redshift driver. e.g.42
.2)Jdbc url will change from
postgreSQL
toredshift
.Yes try code as below