how can i insert and replace data in table to existing row from java, depends on ID?
I want to give statement like that
insert into rooms(status) values('occupied')
where id_room = 5;
You need to use
update statement instead of
Update rooms set status = 'accupied' where Id = 5
So now the table will update the data with the new values.