Here you can find the source of createDbConnection(String dbUrl, String dbUser, String dbPass, String dbDriverClass)
private static Connection createDbConnection(String dbUrl, String dbUser, String dbPass, String dbDriverClass) throws SQLException
//package com.java2s; import java.sql.*; public class Main { private static Connection createDbConnection(String dbUrl, String dbUser, String dbPass, String dbDriverClass) throws SQLException { try {//from w ww.j a va 2 s. c o m Class.forName(dbDriverClass).newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new RuntimeException(e); } return DriverManager.getConnection(dbUrl, dbUser, dbPass); } }