我正在尝试使用JDBC连接到amazon athena。由于我没有在maven上找到 AthenaDriver 存储库,我自己在 github上。基本上我正在做的是:
I'm trying to connect to amazon athena using JDBC. As I didn't find the AthenaDriver repository on maven, I created it myself on my github. Basically what I'm doing is this:
pom.xml:
<repository> <id>mvn-rep</id> <name>maven repository</name> <url>github/raphael-psr/maven-repository/raw/master/</url> </repository> <dependency> <groupId>com.amazonaws.athena.jdbc</groupId> <artifactId>AthenaJDBC41</artifactId> <version>1.1.0</version> </dependency>java:
class.forName("com.amazonaws.athena.jdbc.AthenaDriver"); Properties properties = new Properties(); properties.setProperty("user", user); properties.setProperty("password", password); properties.setProperty("aws_credentials_provider_class", "amazon.AmazonCredentialsProvider"); Connection connection = DriverManager.getConnection("jdbc:awsathena://athena." + region + ".amazonaws:443", properties);引发异常:
java.sql.SQLException:没有为jdbc找到合适的驱动程序:amazonaws://athena.us-east-1.amazonaws:443
java.sql.SQLException: No suitable driver found for jdbc:amazonaws://athena.us-east-1.amazonaws:443
任何人都知道它可能是什么?
Anyone knows what it might be?
推荐答案从 s3.amazonaws/athena-downloads/drivers/AthenaJDBC41-1.1。 0.jar
将jar添加到您自己的maven存储库
Add the jar to your own maven repository
mvn install:install-file -Dfile=/home/sumit/Downloads/AthenaJDBC41-1.1.0.jar -DgroupId=com.amazonaws.athena.jdbc -DartifactId=athenaJDBC -Dversion=1.1.0 -Dpackaging=jar将 -Dfile 值更改为下载的jar路径。 如果需要,请更新 -Dversion 。
change -Dfile value to your downloaded jar path. If required update -Dversion.
为您的pom.xml添加相关性
Add dependency to your pom.xml
<dependency> <groupId>com.amazonaws.athena.jdbc</groupId> <artifactId>athenaJDBC</artifactId> <version>1.1.0</version> </dependency>更多推荐
没有为jdbc找到合适的驱动程序:amazonaws
发布评论