The first thing to understand is that the amazon documentation tells you to download the version of the v4 driver JAR file. If you downloaded the driver, you received the v4X driver version, so your code should be:
Class.forName("com.amazon.redshift.jdbc41.Driver");
NOT
Class.forName("com.amazon.redshift.jdbc4.Driver");
Note the addition of the version number in the first example!
The jar driver is here:
http://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html
Amazon doesn't publish to Maven (Come on Amazon WTF?), So you need to import the downloadable jar. The Maven import command (for JDBC) is as follows:
mvn install: install-file -Dfile =. / RedshiftJDBC41-1.1.10.1010.jar -DgroupId = com.amazon -DartifactId = redshift.jdbc41 -Dversion = 1.1.10.1010 -Dpackaging = jar -DgeneratePom = true
The Maven dependency looks like this (note that artificatID and Version should be what you gave it in the mvn command above. If the driver was updated, then the mvn command and the dependency fields should change):
<dependency> <groupId>com.amazon</groupId> <artifactId>redshift.jdbc41</artifactId> <version>1.1.10.1010</version> </dependency>
David urry
source share