Here you can find the source of getDriverClassName(String rawUrl)
public static String getDriverClassName(String rawUrl) throws SQLException
//package com.java2s; import java.sql.SQLException; public class Main { private static final String ORACLE_DRIVER = "oracle.jdbc.driver.OracleDriver"; private static final String MYSQL_DRIVER = "com.mysql.jdbc.Driver"; public static String getDriverClassName(String rawUrl) throws SQLException { if (rawUrl.startsWith("jdbc:mysql:")) { return MYSQL_DRIVER; } else if (rawUrl.startsWith("jdbc:oracle:")) { return ORACLE_DRIVER; } else {/* www .j av a 2 s. c o m*/ throw new SQLException("unkow jdbc driver : " + rawUrl); } } }