24 |
|
|
25 |
//static boolean DEBUG = false; |
//static boolean DEBUG = false; |
26 |
|
|
27 |
private static TaskLogger logger = TaskLogger.getInstance(); |
private TaskLogger logger = TaskLogger.getInstance(); |
28 |
|
|
29 |
static Properties queries; |
Properties queries; |
30 |
|
|
31 |
static { |
public DatabaseCoverageUpdate() throws SQLException { |
32 |
try { |
|
33 |
//On some platforms it may be necessary to load as "META-INF/queries.properties" |
//On some platforms it may be necessary to load as "META-INF/queries.properties" |
34 |
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); |
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); |
35 |
InputStream is = classLoader.getResourceAsStream("sql.xml"); |
InputStream is = classLoader.getResourceAsStream("sql.xml"); |
36 |
|
|
37 |
queries = new Properties(); |
queries = new Properties(); |
38 |
|
try { |
39 |
queries.loadFromXML(is); |
queries.loadFromXML(is); |
|
|
|
|
|
|
40 |
} catch (Exception e) { |
} catch (Exception e) { |
41 |
logger.warning("error", e); |
throw new SQLException("Error loading queries", e); |
|
throw new RuntimeException(e); //Escalate it to a runtime exception |
|
42 |
} |
} |
43 |
|
|
44 |
} |
} |
45 |
|
|
46 |
|
|