Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1.  Connection connect = DriverManager.getConnection("jdbc:hive2://localhost:10000/default", "", "");   //connecting to default database
  2.     Statement state = connect.createStatement();
  3.  
  4.     System.out.println("!!!!!!!!!!Running 1st query!!!!!!!!!!");
  5.    
  6.     System.out.println("Listing tables in hive");
  7.     ResultSet show_tables = state.executeQuery("show tables");
  8.     while (show_tables.next()) {
  9.         System.out.println(show_tables.getString(1));
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement