Java Api update Script (multiple Parameters)

my Java App does a SQL Request to get some Data.
This Data is in a resultset, now I would like to update this Data from the Database in my Elasticsearch Index.

HashMap<String, Object> params = new HashMap<String, Object>();
for(int i = 1; i<count;i++){
params.put(metaData.getColumnName(i), SQLrs.getString(i));

for(int i = 1; i<count;i++){
client.prepareUpdate(idxName, tableName, ID)

I hope this is correct so far, but I don't know how to set the Script to get all of the Parameters.

Before I tried to form many different scripts (setScript("ctx._source."+metaData.getColumnName(i)+""="+SQLrs.getString(i)""))
But this was refused & I don't think this is the right way.

I hope somebody can help me with this.