Here you can find the source of getConnection()
public static Connection getConnection()
//package com.java2s; //License from project: Apache License import java.sql.*; public class Main { public static String driver = "org.apache.hive.jdbc.HiveDriver"; public static String url = "jdbc:hive2://172.16.19.156:10000/default"; public static Connection getConnection() { try {//from www . j a v a2 s.c om Class.forName(driver); return DriverManager.getConnection(url, "", ""); } catch (SQLException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } }