Here you can find the source of getConnection()
public synchronized static Connection getConnection()
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Main { public synchronized static Connection getConnection() { try {/* www . ja v a 2 s. c o m*/ Connection conn = DriverManager.getConnection("jdbc:hive://master.hadoop:10000/myhive", "", ""); return conn; } catch (SQLException e) { e.printStackTrace(); } return null; } }