Here you can find the source of getDriverClassNameByJdbcUrl(String url)
public static String getDriverClassNameByJdbcUrl(String url)
//package com.java2s; //License from project: Apache License public class Main { public static String getDriverClassNameByJdbcUrl(String url) { if (url.startsWith("jdbc:mysql:")) { return "com.mysql.jdbc.Driver"; } else if (url.startsWith("jdbc:postgresql:")) { return "org.postgresql.Driver"; } else if (url.startsWith("jdbc:sqlserver:")) { return "com.microsoft.sqlserver.jdbc.SQLServerDriver"; } else if (url.startsWith("jdbc:jtds:sqlserver:")) { return "net.sourceforge.jtds.jdbc.Driver"; } else if (url.startsWith("jdbc:h2:")) { return "org.h2.Driver"; } else {/*from w w w .j a va 2 s. com*/ return ""; } } }