--- dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/db/DatabaseCoverageUpdate.java 2016/05/02 08:00:47 3034 +++ dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/db/DatabaseCoverageUpdate.java 2016/05/02 17:50:14 3035 @@ -24,25 +24,23 @@ //static boolean DEBUG = false; - private static TaskLogger logger = TaskLogger.getInstance(); + private TaskLogger logger = TaskLogger.getInstance(); - static Properties queries; + Properties queries; - static { - try { - //On some platforms it may be necessary to load as "META-INF/queries.properties" - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - InputStream is = classLoader.getResourceAsStream("sql.xml"); + public DatabaseCoverageUpdate() throws SQLException { + + //On some platforms it may be necessary to load as "META-INF/queries.properties" + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + InputStream is = classLoader.getResourceAsStream("sql.xml"); - queries = new Properties(); + queries = new Properties(); + try { queries.loadFromXML(is); - - } catch (Exception e) { - logger.warning("error", e); - throw new RuntimeException(e); //Escalate it to a runtime exception + throw new SQLException("Error loading queries", e); } - + }