public void executeSql(String resource, Connection conn, String tablePrefix) throws Exception
{
InputStream is = Loader.getResourceAsStream(resource);
if (is == null) {
log.debug("Trying the classloader of the class itself. (workaround for maven2)");
Loader loader = new Loader();
is = loader.getResourceAsStreamFromClass(resource);
}
String sql = getString(is);
sql = sql.replaceAll("(?m)^--([^\n]+)?$", ""); // Remove all commented lines
sql = sql.replaceAll("\\$\\{prefix}", tablePrefix);
is.close();