mikedaruke
Technical User
I want to use a select * from table;
Now i would not know how many columns or fields returned.
I wrote this to try and print, and it throws and MSQL exeception. Help! Anybody have an easier way.
// Print Results here
int count = 0;
while(rs.next()) {
while(rs.getBoolean(count)){ //testing if true?
count++;
System.out.println(rs.getString(count));
// Printout
}
}
I just don't want to hardcode rs.getString(1) etc.
Thanks!
Now i would not know how many columns or fields returned.
I wrote this to try and print, and it throws and MSQL exeception. Help! Anybody have an easier way.
// Print Results here
int count = 0;
while(rs.next()) {
while(rs.getBoolean(count)){ //testing if true?
count++;
System.out.println(rs.getString(count));
// Printout
}
}
I just don't want to hardcode rs.getString(1) etc.
Thanks!