Here you can find the source of getConnections(String driver, String url, String user, String pwd)
private static Connection getConnections(String driver, String url, String user, String pwd) throws Exception
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.DriverManager; import java.util.Properties; public class Main { private static Connection getConnections(String driver, String url, String user, String pwd) throws Exception { Connection conn = null;/* ww w .j ava 2 s .c o m*/ try { Properties props = new Properties(); props.put("remarksReporting", "true"); props.put("user", user); props.put("password", pwd); Class.forName(driver); conn = DriverManager.getConnection(url, props); } catch (Exception e) { e.printStackTrace(); throw e; } return conn; } }