【问题标题】:Hive JDBC connection in JAVAJAVA 中的 Hive JDBC 连接
【发布时间】:2018-10-17 11:28:50
【问题描述】:

错误:

原因:org.apache.thrift.transport.TTransportException:不能 创建 http 连接到 jdbc:hive2://xxxxxxxxxx.azurehdinsight.net:443/default;transportMode=http;ssl=true;httpPath=/hive2。 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>

【问题讨论】:

  • 检查您的集群用户访问权限

标签: java jdbc hive


【解决方案1】:

查看wikipedia 以获取更多详细信息:

当客户端不被允许访问时返回 HTTP 403 除了身份验证之外的某种原因的资源

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多