Support Questions

Find answers, ask questions, and share your expertise

JDBC string for HIVE

avatar
Rising Star

I have installed VNC server on Ambari(HDP Sandbox). From Eclipse on VNC Client, I want to query Hive database. What is the JDBC string I should use? I looked at other posts. Its very confusing. I am using HDP 2.3.2.

Please help.

1 ACCEPTED SOLUTION

avatar

@Vidya SK

Double check that you have all the Hive JDBC jar files

FOR HDP 2.3.x

From /usr/hdp/current/hive-client/lib/ sftp or scp to your local desktop

  • hive-jdbc.jar

From /usr/hdp/current/hadoop-client

  • hadoop-common.jar
  • hadoop-auth.jar

User name: hive

Password: hive

I cannot remember if the Sandbox is setup with Hive run as user = false or not. Need to double check. As was indicated earlier use URL

jdbc:hive2://127.0.0.1:10000 

See also the answers for a related question

View solution in original post

6 REPLIES 6

avatar

Since HDP Sandbox is on one node and you are running the eclipse also on the same node then you should be able to connect using jdbc:hive2://localhost:10000.

avatar
Rising Star

@de

I have added jar files and connection details. Connection failed. Please suggest.

1402-hive-jdbc-2.jpg

1401-hive-jdbc-1.jpg

,@Deepesh

Thanks Deepesh. Please find screen shots below. I have added JAR files and database connection details. connection failed. Please help

1399-hive-jdbc-1.jpg

1400-hive-jdbc-2.jpg

avatar
Master Guru

Please take look here. Great info on connection details for jdbc https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients

avatar

@Vidya SK

Double check that you have all the Hive JDBC jar files

FOR HDP 2.3.x

From /usr/hdp/current/hive-client/lib/ sftp or scp to your local desktop

  • hive-jdbc.jar

From /usr/hdp/current/hadoop-client

  • hadoop-common.jar
  • hadoop-auth.jar

User name: hive

Password: hive

I cannot remember if the Sandbox is setup with Hive run as user = false or not. Need to double check. As was indicated earlier use URL

jdbc:hive2://127.0.0.1:10000 

See also the answers for a related question

avatar
Rising Star

@Ancil McBarnett

It worked !! Great !!! Thanks a lot Ancil.

avatar
Super Collaborator

I'd recommend to test connectivity first. You can do it with beeline tool. Once you connected to jdbc url from beeline u can continue experiments with eclipse.