I am using microsoft access (I thought for convenient testing) as the back
end of a servlet. No matter what I try, I keep getting an "invalid cursor
state" error with even the simplest query.
I have a system data source set up and I am able to connect fine. Here is
the code I am using:
Statement libraryStatement = libraryConnection.makeProgramConnection();
// get count of records in database
int recordCount=0;
String libraryQuery = "SELECT count(*) FROM caLibraries";
try {
ResultSet libCount = libraryStatement.executeQuery("SELECT
count (*)
FROM caLibraries");
recordCount = libCount.getInt(1);
libraryConnection.closeConnection();
} catch (SQLException sqlexception) {
for(; sqlexception != null; sqlexception =
sqlexception.getNextException()) {
System.out.println("SQLState :" +
sqlexception.getSQLState());
System.out.println("Message: " +
sqlexception.getMessage());
System.out.println("Vendor: " +
sqlexception.getErrorCode());}
}
return recordCount;
I can't find any documentation explaining what this error means. Any help
is appreciated.
____________________________________
Adam Smith
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html