I want to add database elements into array. how do I do that.
the table row has elements a to d.
i want to do this because. I have created a quiz and each time the user answers a question the answer in stored in a database. the questions are multiple choice. so a, b, c or d. (there are 5 questions) i am creating a servlet score page. so once they are in an array the i can check each element.
here is my code
private String ans[];
...
int i = 0;
while (rs.next()) {
ans[i] = {rs.getString(1)};
i++;
}