Here you can find the source of getConnection(String url, String username, String password)
public static Connection getConnection(String url, String username, String password)
//package com.java2s; //License from project: Apache License import java.sql.*; public class Main { private static Connection conn; public static Connection getConnection(String url, String username, String password) { if (null == conn) { try { conn = DriverManager.getConnection(url, username, password); } catch (SQLException e) { e.printStackTrace();/*from w ww .j a va 2 s . c o m*/ throw new RuntimeException(e); } } return conn; } }