tags:

views:

48

answers:

2

How display ResultSet in JTable. i using this code

/*String [] record= new 
String[ColCount]; 
for (i=0; i<ColCount; i++) 
{ 
record[i]=rset1.getString(i+1); 

} 
cell[i] = rset1.getString("loginname"); 
cell[i] = rset1.getString( "role"); 
System.out.println(cell[i][0]);
//ItemGroup = rset1.getString( "Status"); 
} 
System.out.println(ItemCode);
JTable jt = new JTable( 
cell[i], headers);*/ 

but i get only one row that lastly inserted to database.

+1  A: 

You need to put a while loop around your code to iterate over the result set. eg,

while(rset1.next())
{
//do something
}
grahamrb
+1  A: 

Check out this similar question.

Adamski