private void cmd_nextActionPerformed(java.awt.event.ActionEvent evt) {
pst=conn.prepareStatement("select * from questions where subject= ?");
pst.setString(1, "websites");
rs=pst.executeQuery();
while(rs.next())
{
qs=rs.getString("question");
option1=rs.getString("option1");
option2=rs.getString("option2");
option3=rs.getString("option3");
txt_quest.setText(qs);
jcb_opt1.setText(option1);
jcb_opt2.setText(option2);
jcb_opt3.setText(option3);
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(null, ex);
}
}
我想在单击按钮时从表中获取下一行,在单击next
按钮时获取上一行previous
。有什么简单的方法可以做到这一点...?