Here you can find the source of getConnection(Properties prop)
public static Connection getConnection(Properties prop)
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Properties; public class Main { public static Connection getConnection(Properties prop) { Connection conn = null;//ww w .j a v a2 s . c o m try { if (conn == null) { conn = DriverManager.getConnection("jdbc:phoenix:yahoo005.nicl.cs.duke.edu:2181", prop); ResultSet rs = conn.prepareStatement("select count(*) from nation").executeQuery(); while (rs.next()) { System.out.println("row count " + rs.getInt(1)); } System.out.println("Connection established successfully"); } } catch (SQLException e) { System.err.println("Error in getting zookeeper connection"); e.printStackTrace(); } return conn; } }