GroovySql: How to update a table with Arraylist variables
问题 I am trying to write an GroovySQL script that will have three different Arraylist variable. A1[1,2,3],A2[4,5,6],A3[7,8,9]. I want to update the table such that three rows of the three columns of the table are updates as Data should be (in row wise) R1: 1,4,7 R2: 2,5,8 R3: 3,6,9 def sql = Sql.newInstance("jdbc:mysql://localhost:3306/words", "Test", "test", "com.mysql.jdbc.Driver") def nid = 1 def newupdate = "hello world" sql.executeUpdate("update word set spelling = ? where word_id = ?", [