Where is Apache Hive JDBC driver for download? [cl

2019-01-15 14:26发布

I need to connect to Hive from Java program via JDBC. I searched google and found numerous guides and examples like this: HiveServer2 clients

However, I could not find the JDBC driver itself (jar file) anywhere. There seem to be a jar file for download from Cloudera, but it requires registration.

Does anyone know where to get the plain Apache Hive JDBC driver itself ?

标签: java jdbc hive
4条回答
时光不老,我们不散
2楼-- · 2019-01-15 14:47

Add this dependency to your Maven pom:

<dependency>
    <groupId>org.apache.hive</groupId>
    <artifactId>hive-jdbc</artifactId>
    <version>2.0.0</version>
</dependency>

The jar can be downloaded from: http://central.maven.org/maven2/org/apache/hive/hive-jdbc/2.0.0/hive-jdbc-2.0.0.jar

Complete list of versions: http://www.mvnrepository.com/artifact/org.apache.hive/hive-jdbc

查看更多
做个烂人
3楼-- · 2019-01-15 14:56

Using the Apache driver is fine if your program runs on a host with all the Hadoop libs already installed. Otherwise you will have to drag a smorgasbord of dependencies i.e.

  • hive-jdbc*-standalone.jar (the large one)
  • hadoop-common*.jar
  • hadoop-auth*.jar (for Kerberos only)
  • commons-configuration*.jar
  • the SLF4J family and friends

Packaging all these dependencies in your own JAR will probably result in a massive, cluttered piece of shoftware (God, how Maven is misused nowadays). Plus, you may have compatibility issue because newer clients are not compatible with older servers. "Not compatible" meaning "unable to initialize connection with Thrift server".

For a standalone install the Cloudera driver may be a good solution - registration just means leaving one of your "junk" e-mails to get a couple of marketing messages (and you can un-subscribe then). Although I admit I've never used it on a non-Cloudera cluster.

查看更多
别忘想泡老子
4楼-- · 2019-01-15 15:02

You can download the driver from here.Download hive-jdbc-0.10.0.jar

查看更多
Explosion°爆炸
5楼-- · 2019-01-15 15:04

You can download an uber jar here:

https://github.com/timveil/hive-jdbc-uber-jar/releases

Works straightaway.

查看更多
登录 后发表回答