Hi,
I am trying to view all records in a Database through an html page called via a servlet. However the page returns the first row(record) only. I keep getting the following error in Apache Tomcat console window:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Invalid Descriptor Index
below is a code snippet from my servlet
[code]
Statement myStatement = databaseConnection.createStatement(); ResultSet results = myStatement.executeQuery("SELECT * FROM Classmates");
out.println("
");
out.println("NameAddressTownCountyTelephone");
while (results.next())
{
out.println("");
out.println("" + results.getString(1) + " | ");
out.println("" + results.getString(2) + " | ");
out.println("" + results.getString(3) + " | ");
out.println("" + results.getString(4) + " | ");
out.println("" + results.getString(5) + " | ");
out.println("" + results.getString(6) + " | ");
out.println("
");
}
results.close();
out.println("
");
out.println("");
[/code]
How can i fix this error?