SQLException - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

SQLException

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("");
out.println("");
out.println("");
out.println("");
out.println("");
out.println("");
out.println("");
}
results.close();
out.println("
" + results.getString(1) + "" + results.getString(2) + "" + results.getString(3) + "" + results.getString(4) + "" + results.getString(5) + "" + results.getString(6) + "
");
out.println("");
[/code]

How can i fix this error?

Sign In or Register to comment.