Here you can find the source of getConnection()
public static Connection getConnection() throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; public class Main { private static Properties props = null; public static Connection getConnection() throws SQLException { return DriverManager.getConnection(props.getProperty("url"), props.getProperty("username"), props.getProperty("password")); }/*from ww w. ja v a 2 s .c o m*/ }