Class driverClass = getApplication().getClassLoadingService().loadClass(
currentDataSource.getJdbcDriver());
Driver driver = (Driver) driverClass.newInstance();
// connect via Cayenne DriverDataSource - it addresses some driver issues...
Connection c = new DriverDataSource(
driver,
currentDataSource.getUrl(),
currentDataSource.getUserName(),
currentDataSource.getPassword()).getConnection();
try {