import groovy.sql.Sql import org.codehaus.groovy.grails.commons.ConfigurationHolder as CH String sqlFilePath = ApplicationHolder.application.parentContext.servletContext.getRealPath("/data/table_dump.sql") String sqlString = new File(sqlFilePath).text Sql sql = Sql.newInstance(CH.config.dataSource.url, CH.config.dataSource.username, CH.config.dataSource.password, CH.config.dataSource.driverClassName) sql.execute(sqlString)
About digital things I find interesting. Like internet, software development, mobile phones, social media
About Me
- Olaf
- Freelancing software developer / architect, mobile geek. Topics: Software technologies (java, groovy, agile), politics, web, science, green, mobile, android.
Homepage: www.tutaona.com
"The absence of limitations is the enemy of art." - Orson Welles
Donnerstag, 10. Mai 2012
Executing a SQL Script on Startup
Abonnieren
Kommentare zum Post (Atom)
Keine Kommentare:
Kommentar veröffentlichen