@SuppressWarnings("unchecked")
DataSource database = getJndiDataSource((Class<Context>) driverClass, url);
if (user == null && password == null) {
return database;
} else {
return new DataSourceWrapper(database, user, password);
}
} else {
return getDriverDataSource(driverClass, url, user, password);
}
}