How can you do batch insertion with groovy Sql while simulating prepared statements? All the examples that I found are similar to the following and do not use prepared instructions.
withBatch { stmt ->
stmt.addBatch("insert into table (field1,field2) values('value1','value2')")
stmt.addBatch("insert into table (field1,field2) values('value3','value4')")
}
According to this link http://jira.codehaus.org/browse/GROOVY-3504 it is impossible to use prepared statements directly from within the package. What is the best way to simulate this, so I can avoid having to write my own code to avoid sql injection?
Jared source
share