Here you can find the source of getConnection(String subprotocol, String subname, String user, String password)
public static Connection getConnection(String subprotocol, String subname, String user, String password)
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; public class Main { public static Connection getConnection(String subprotocol, String subname, String user, String password) { Connection conn = null;/*from w ww .jav a2s. co m*/ String conDetails = "jdbc:" + subprotocol + ":" + subname + "?user=" + user + "&password=" + password; try { conn = DriverManager.getConnection(conDetails); } catch (Exception e) { } return conn; } }