Here you can find the source of getConnection()
public static Connection getConnection()
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; public class Main { private static String url; private static String username; private static String password; public static Connection getConnection() { Connection con = null;//from ww w . jav a 2 s. c o m try { con = DriverManager.getConnection(url, username, password); } catch (Exception e) { e.printStackTrace(); } return con; } }