繁体   English   中英

JAVA中的Hive JDBC连接

[英]Hive JDBC connection in JAVA

错误:

引起原因:org.apache.thrift.transport.TTransportException:无法创建与jdbc:hive2://xxxxxxxxxx.azurehdinsight.net:443 / default; http:transportMode = http; ssl = true; httpPath = / hive2的http连接。 HTTP响应码:403

码:

public static void main(String[] args) throws SQLException {
    Class.forName("org.apache.hive.jdbc.HiveDriver");
    Connection con = DriverManager.getConnection("jdbc:hive2://xxxxx.azurehdinsight.net:443/default;transportMode=http;ssl=true;httpPath=/hive2", "xxx", "xxx");
    Statement stmt = con.createStatement();
...
}

我的Hive版本:1.2.1.2.5

我的pom文件:

<dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-jdbc</artifactId>
        <version>1.2.0</version>
        <classifier>standalone</classifier>
</dependency>

查看Wikipedia表格,了解更多详细信息:

当除身份验证外,由于某种原因不允许客户端访问资源时,返回HTTP 403

检查您的证书(如果证书已过期等),并检查您的用户是否具有访问Hive的适当权限。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM