没有为jdbc找到合适的驱动程序:amazonaws [英] No suitable driver found for jdbc:amazonaws

查看:235
本文介绍了没有为jdbc找到合适的驱动程序:amazonaws的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用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>https://github.com/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.com:443", properties);

引发异常:


java.sql.SQLException:没有为jdbc找到合适的驱动程序:amazonaws://athena.us-east-1.amazonaws.com:443

java.sql.SQLException: No suitable driver found for jdbc:amazonaws://athena.us-east-1.amazonaws.com:443

任何人都知道它可能是什么?

Anyone knows what it might be?

推荐答案

https://s3.amazonaws.com/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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆