Giriş
Şu satırı dahil ederiz
execute metoduimport org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
Örnek
Şöyle yaparız
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();Resource[] resources = resolver.getResources(ExecuteSqlScriptRunner.BASE_SCRIPT_FOLDER +
dirName + "/*.sql");public void executeScript(Resource script) {ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator(script);boolean success = true;String error = null;try {databasePopulator.execute(this.dataSource);} catch (ScriptException e) {...}}
Hiç yorum yok:
Yorum Gönder