Hi folks! this is the code thats giving me problems.
try{
ResultSet rs = Main.dbase.search("select * from myTable");
//rs.next()
while(rs.next())
{
cmb.addItem(rs.getString(1).trim());
}
rs.close();
} catch (Exception ex) {System.out.println(ex);}
here dbase is an object executing Statement.executeQuery
, and cmb is JComboBox. the problem is that even though the table has 10 rows, i get only single row in cmb. if I don't comment out the first rs.next()
, i get the 2nd row in cmb. i tried to track the value of rs.next()
and found that after while(rs.next())
it gives out false
, always. My target is to get all the 10 values in cmb.
TheMrProgrammer http://www.icbse.com/2009/funny-exam-answers-school-students http://download.cnet.com/TheCalcMan/3000-2094\_4-10958266.html