how can I batchUpdate with a query that requires 2 parameters and only one of them is stored in a list
I use Spring-JDBC to insert the list of facebook friends for a user in my MySQL database. I have a final Long that contains the user uid and a List that contains the list of his friends. my query is: final String sqlInsert="insert into fb_user_friends(fb_uid,friend_uid) values(?,?)"; I create batch parameters using SqlParameterSourceUtils SqlParameterSource[] batch = SqlParameterSourceUtils.createBatch(friendsList.toArray()); and I execute the insert using: int[] insertCounts = this._jdbcTemplate.batchUpdate(sqlInsert,batch); the problem here that the list contains only the 2nd parameter that