Groovy Version: 1.7.0 JVM: 1.6.0_18
mysql-connector-java-3.1.14-bin.jar
import
groovy.sql.Sqldef getConn() {
def sql = Sql.newInstance("jdbc:mysql://localhost:3306/aaa", "bbb",
"bbb", "
com.mysql.jdbc.Driver")
sql
}
def sql = getConn()
def setupAllTables(sql) {
"mysql -ubbb -pbbb aaa < createdb.sql".execute().waitFor() //does
nothing, if I run that from the command line it works correctly.
sql.execute("source /my/path/to/the/file/createdb.sql") //fails,
works from a mysql prompt
}
I'm trying to set up a known working set of data in the database
during my startup script due to a bug I spent far too long
troubleshooting. How do I do this from within groovy?
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email