没有为jdbc找到合适的驱动程序:amazonaws

编程入门 行业动态 更新时间:2024-10-26 20:30:28
本文介绍了没有为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>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

本文发布于:2023-10-18 23:44:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1505769.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:驱动程序   合适   jdbc   amazonaws

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!