is there a method to get the size of a result set after executing a query? I have the following code after the query is executed:
this is relating to my question to attempt to print a set of names with commas in between them and an "and" between the last two.
e.g.
"bob, same, george, and sam"
or
"bob and sam
Code:
...
int rsSize = rs.length(); //<-- length(), size()?
int counter = 0;
while(rs.next()){
String name = rs.getString("first");
if (counter == rsSize -1){
out.print(name+" and ");
}
else{
out.print(name+", ");
counter++;
}
}
con.close();
%>
this is relating to my question to attempt to print a set of names with commas in between them and an "and" between the last two.
e.g.
"bob, same, george, and sam"
or
"bob and sam