} catch ( NamingException ex ) {
ctxEvent.getServletContext().log( "Naming exception occured during java:comp/env/sonar lookups", ex );
}
if ( url != null && driver != null && password != null && username != null ) {
batch = new Batch( url, driver, username, password );
} else if ( jdbcDialect != null ) {
batch = new Batch( datasource, jdbcDialect );
} else {
ctxEvent.getServletContext().log( "Missing JDBC settings" );
}
if ( batch != null ) {