I am using the following code to update my mysql database
String sql = "update stocks set price = ?, high = ?, change = ? where SYMBOL = ?";
PreparedStatement stmt = conn.prepareStatement(sql);
for(int i=0;i<ing;i++)
{
stmt.setString(1, price[i]);
stmt.setString(2, high[i]);
stmt.setDouble(3, changedvalue[i]);
stmt.setString(4, SYMBOL[i]);
stmt.addBatch();
}
stmt.executeBatch();
where changedvalue is a array of type double. If i remove change it executes properly. But with it it throws the following error.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change = 0.1 where SYMBOL = ''' at line 1 What is the issue
changein the database?