setDriverClassName(String driverClassName)
引數說明:public static void main(String[] args){ String driver = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://lzw:3306/testDatabase"; String username = "root"; String password = "111"; DriverManagerDataSource dmd = new DriverManagerDataSource(url); dmd.setDriverClassName(driver); //設定資料庫的驅動類 …… //省略獲取資料庫連線和其他操作 }