public void testConnection(String driver, String url, String username, String password) throws DriverNotFoundException, SQLException {
try {
Class.forName(driver);
} catch (ClassNotFoundException ex) {
throw new DriverNotFoundException(ex);
}
connection = DriverManager.getConnection(url, username, password);
}