Here you can find the source of createDriver(String driverClassName)
public static Driver createDriver(String driverClassName) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.Driver; import java.sql.SQLException; public class Main { public static Driver createDriver(String driverClassName) throws SQLException { Class clazz = null;//ww w .j a v a 2 s . c om try { ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); if (contextLoader != null) { clazz = contextLoader.loadClass(driverClassName); } } catch (ClassNotFoundException e) { } if (clazz == null) { try { clazz = Class.forName(driverClassName); } catch (ClassNotFoundException e) { throw new SQLException(e.getMessage(), e); } } try { return (Driver) clazz.newInstance(); } catch (IllegalAccessException e) { throw new SQLException(e.getMessage(), e); } catch (InstantiationException e) { throw new SQLException(e.getMessage(), e); } } }