0

I am trying to connect Hive database with my Java code. I have googled a lot and found about Hive_Client, but there were so many errors, and dependency, can someone help me out with the code and the library files required for them.

Ashok
  • 2,411
  • 1
  • 13
  • 23
  • My advice > see http://stackoverflow.com/questions/36005061/where-is-apache-hive-jdbc-driver-for-download/36005379#36005379 > and Kerberos authentication adds a good deal of pain, cf. http://stackoverflow.com/questions/39362326/connect-to-kerberised-hive-using-jdbc-from-remote-windows-system/39365297#39365297 – Samson Scharfrichter Mar 19 '17 at 20:39
  • Thanks for that help, Since I am new to this, can you please elaborate, which libraries they meant by "the SLF4J family and friends" in the first link – Ashok Mar 20 '17 at 02:02
  • The way Hadoop does its logging, it's `slf4j-api.jar` + `slf4j-log4j12.jar` + `log4j.jar` – Samson Scharfrichter Mar 20 '17 at 18:03

1 Answers1

0

Hive provides a JDBC driver which can i.e. be found in the Maven Repo. Examples on how to connect via JDBC are provided in the Hive docs.

ldz
  • 2,217
  • 16
  • 21
  • Yes sir/ma'am, I completely agree with you, but with that jar files, I need some more jar files. By this question, I want to know them. – Ashok Mar 19 '17 at 19:32
  • What about using a build tool like gradle or maven, which takes care of all needed dependencies? If that's not an option, they are listed in the aforementioned Maven repository. – ldz Mar 19 '17 at 19:38
  • No sir/ma'am , I am talking about with hive_client**.jar, the other libraries like hadoop-auth**.jar, hadoop-common**.jar – Ashok Mar 19 '17 at 20:10
  • And I'm suggesting using the JDBC driver as an alternative. – ldz Mar 19 '17 at 20:22
  • My 2 cents: that Hive JDBC driver is a joke. Even the "standalone" JAR has dependencies to the Hadoop client, and in case you use kerberos auth, you also need the *native* libs (too bad there is no official build for Windows...) Plus the lack of backward compatibility on client side. Plus the fact that it's not JDBC4-compliant. Plus the fact that is not wholly JDBC-compliant, some tools will refuse to use it because it implements so little of the API. – Samson Scharfrichter Mar 19 '17 at 20:46