• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HiverServer1 Connection timed out

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all!
I'm with a JDBC program to connect to hive and extract data from a DB.
Here is a part of my code:



Of course, I write my own user and password in the corresponding part.
When I execute that code, I get this message:



Line 39 is "Statement stmt = con.createStatement(); "
Could anyone help me with this problem? Server is online because it answers my pings.
Thank you so much.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming your connection string is correct. The problem is which exception (ClassNotFoundException or SQLException) gives you the null? The first one or second one?

Is the driver class in the classpath when you run the program?
 
adrian barredo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! It's the second try catch what gives me error. Hive driver is loaded in the proyect library (I use netbeans)
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then I suggest you use the other getConnection() method:


If that doesn't work, you connection string may be wrong. Is there a "default" database?
 
adrian barredo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi! thanks for you response.

"default" database should exist, it's in the main guide:

http://forge.fi-ware.org/plugins/mediawiki/wiki/fiware/index.php/BigData_Analysis_-_User_and_Programmer_Guide#Installing_Cosmos_CLI

I've tried your code and I get this message now, I think we're on the good way:

 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apparently that's the same error, still a NullPointerException for "conn".

Check out https://cwiki.apache.org/confluence/display/Hive/HiveClient (the user and password in the sample code is blank). Maybe you don't need a user/password for default database.
 
adrian barredo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that's the standalone hive. I've used that code some days ago and it worked properly.
Nowadays what I'd like to do is to connect to a remote Hive, not to a local one.
I've tried to send the user and password fields in blank, to send my own user data or to send "myuser" "mypasswd", but I don't get it yet.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic