0 Replies - 6527 Views - Last Post: 02 July 2012 - 10:24 PM Rate Topic: -----

#1 raihan26   User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 47
  • Joined: 04-February 10

Access Hive Tables using JDBC

Posted 02 July 2012 - 10:24 PM

I am trying to access Hive Metadata using JDBC. I have added all the jar files required in the classpath. I was following the tutorial from here- `https://cwiki.apache...HiveClient-JDBC`

After adding all the jar files I tried to wrote a sample program to connect to Hive using Java. When I debug the code, as soon as it hit the below line.

Connection con = 
    default","", "");

I always get this exception. Not sure why is it happening. Can anyone help me how to fix this problem?

java.sql.SQLException: Could not establish connection to 
    lvsaishdc3in0001.lvs.host.com:10000/default: java.net.ConnectException: Connection
    timed out: connect

I started my Hive sever by logging into Putty and passing the hostname.

 $ bash
    bash-3.00$ cd /usr/local/bin
    bash-3.00$ hive --service hiveserver
    Starting Hive Thrift Server
    12/07/03 08:07:11 INFO service.HiveServer: Starting hive server on port 10000

Is This A Good Question/Topic? 0
  • +

Page 1 of 1