说我有这个查询“select * from lessons”,其中有一个名为lesson_code和lessons_name的列。
然后我将其提取到结果集。
然后我想从文本字段中获取值然后我尝试在lesson_code列中找到它,然后从textfield中找到另一个值,但这次我尝试在lessons_name列上找到它
如何遍历某个列,还是有其他方法可以做到这一点?
//some other codes
//lessons table has lesson_code and lesson_name column
String query = "select * from lessons";
ResultSet rset = statement.executeQuery(query);
//need to find this value in lesson_code if it exists
code_val = codeTextField.getText();
//need to find this value in lesson_name if it exists
name_val = nameTextField.getText();