DBConnectionProblems...

On my machine I have MS Access97.
When I fetch records from this DB using e.g. ColdFusion (www.allaire.com) and SQL,
no problems at all.

When I use a servlet I get
"SQLException caught: [Microsoft][ODBC Driver Manager] Invalid cursor state"
Why?
Here is relevant code in the Test.java:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 


// Get a Connection to the database

con = DriverManager.getConnection(

"jdbc:odbc:SQL_DREAM");


// Create a Statement object

stmt = con.createStatement();


// Execute an SQL query, get a ResultSet

rs = stmt.executeQuery("SELECT PROCESSOR FROM ELVBERG_BOOKINGS WHERE ID = 1");


// Display the result set as a list

out.println("<HTML><HEAD><TITLE>Test</TITLE></HEAD>");

out.println("<BODY>");

out.println(rs.getString("processor")); 

out.println("</BODY></HTML>");

-dan

Received on Sunday, 20 June 1999 15:22:29 UTC