this is one of my button behaviors. my problem is resultset.first(); doesnt return the cursor to the first row. this is my code
public void Menu3_next( JTextField jTextField1, JTextField jTextField2, JComboBox jComboBox1, JComboBox jComboBox2){
Connect();
try{
statement = connect.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
resultset = statement.executeQuery("select * from Menu3");
resultset.first();
while(resultset.next()){
jTextField1.setText(String.format("%s", resultset.getString("idMenu3")));
jTextField2.setText(String.format("%s", resultset.getString("Name")));
}
String query1 = String.format("select * from Menu1");// where idMenu1 = '%s'",strBrand);
resultset = statement.executeQuery(query1);
resultset.first();
while(resultset.next()){
jComboBox1.addItem(String.format("%s", resultset.getString("Brand")));
}
String query2 = String.format("select * from Menu2");// where idMenu= '%s'",strPart);
resultset = statement.executeQuery(query2);
resultset.first();
while(resultset.next()){
jComboBox2.addItem(String.format("%s", resultset.getString("Part")));
}
}
catch(SQLException ex){
System.out.println(ex);
}
}
TIA Guys. when i click the button it must show the next, and next and next, until the last row. but it doesnt. it just show the last row.