簡體   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