I'm using JDBC as my servlet and trying manipulate to my database.
id | color | description |
1 | blue | fasfsfafssf |
2 | red | afsafasfasf |
how can I choose all rows where color=blue and change the description based on the id? for now, i have soemthing along the lines:
SELECT id, description FROM table WHERE color="blue"
String description = manipulate(resultset.getInt(id)) //resultset is from executing the query
Now how do i update the description of the same row with description?
hopefully that made sense
EDIT: The problem is that the way that description changes will be based on the ID (therefore the manipulate method).
id - descriptionor repeat the description... I'm asking what you expect the result to be. And if you expect the original data to remain intact. Those are two very big questions that will impact the answer.