protected void createDatabase(String databaseName) throws Exception {
// Search in the classpath for the SQL files for the given database.
String sqlDir = Application.lookup().getBaseCfgDirectory() + File.separator + databaseConfigDir;
Map<String, File> sqlFileMap = new HashMap<String, File>();
DirectoriesScanner scanner = new DirectoriesScanner("sql");
File[] sqlFiles = scanner.findFiles(new File(sqlDir));
for (File sqlFile : sqlFiles) {
// The file name must start with an ordinal which indicates the order of execution and finish with the databaseName.
if (sqlFile.getName().endsWith(databaseName + ".sql") && Character.isDigit(sqlFile.getName().charAt(0))) {
sqlFileMap.put(sqlFile.getName(), sqlFile);
}