Update data from a table to DB

I have used a binding function to populate data in table.In the execute() method i have done a select query operation which fills the table.
When i change the table properties to editable and edit data, it goes back to original value since the polling is not off.

I want the data to be saved in the DB when i edit a cell in the table. How can i achieve this functionality?

An easy generic way is to go into scripting on the table.
Select onCelledited and use a script like this.

	import system
	ID = self.data.getValueAt(rowIndex,"NavID")
	query = "UPDATE Plant_IGN_Navigation SET " + colName + " = ? WHERE NavID = ?"
	values = [newValue, ID]
	system.db.runPrepUpdate(query, values, "ECHGSQL")

Of course replace the values above with your own table variables and update query.

Thank you MMaynardUSG for your response.

I don’t want to do scripting in onCelledited. I want the changed value and column name in my java file so that i can run an update query in the execute() method.

This has to happen only if i have a table component.But my binding function is applicable to other components also.

result = gatewayInterface.runUpdateQuery(query, datasource)

So to form the string query i need the column edited and the new and old values.

onCellEdited is what tells you the table cell was edited and what the new and old values were.