}
}
private static void validateConfiguration(JDBCConfiguration conf) throws ConfigurationException {
if(conf.getDialect() == null) {
throw new ConfigurationException("A dialect must be provided, possible values are H2, Oracle, PostgresSQL");
}
ConnectionPoolConfiguration cp = conf.getConnectionPool();
if(conf.getJNDISource() == null && cp == null && !"H2".equals(conf.getDialect())) {
throw new ConfigurationException("No data source provided, either configure JNDISource or connectionPool");
}
if(cp != null) {
if(cp.getDriver() == null) {
throw new ConfigurationException("No JDBC driver provided");
}
if(cp.getUrl() == null) {
throw new ConfigurationException("No JDBC URL provided");
}
}
}