Here you can find the source of getConnection(Properties pro)
public static Connection getConnection(Properties pro) throws Exception
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.DriverManager; import java.util.Properties; public class Main { public static Connection getConnection(Properties pro) throws Exception { Class.forName(pro.getProperty("jdbc.driver")); return DriverManager.getConnection(pro.getProperty("jdbc.url"), pro.getProperty("jdbc.username"), pro.getProperty("jdbc.password")); }//from www. j av a 2 s . co m }