Here you can find the source of getConnection(String driver, String url, String username, String password)
public static Connection getConnection(String driver, String url, String username, String password) throws ClassNotFoundException, SQLException
//package com.java2s; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Main { public static Connection getConnection(String driver, String url, String username, String password) throws ClassNotFoundException, SQLException { Connection conn = null;//from w ww .ja va 2 s . c om Class.forName(driver); conn = DriverManager.getConnection(url, username, password); return conn; } }