kensington43
Technical User
How can I output this method where I use a for loop to show all the fields:
Currently I am doing it this long way to get the Field info:
Code:
while (rs.next())
{
ResultsetMetaData rsmd = rs.getMetaData();
String myField1 = rsmd.getColumnName(1);
String myField2 = rsmd.getColumnName(2);
String myField3 = rsmd.getColumnName(3);
out.println(myField + "," + myField2 + "," + myField3);
}
My attempt doesnt seem to work because I think I am not correct with my Types?
Code:
while (rs.next())
{
ResultsetMetaData rsmd = rs.getMetaData[20];
for(int i = 0;i < 21;i++)
{
String myField[i] = rsmd.getColumnName(1);
}
out.println(myField1 + "," + myField2 + "," + myField3);
}