W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 1999

DBConnectionProblems...

From: Ragna-Lena&Dan <prepare.enrich@telia.com>
Date: Sun, 20 Jun 1999 14:30:58 -0400 (EDT)
Message-ID: <003b01bebb4a$e939b5c0$c0b8143e@dan>
To: "jigsaw <== dan" <www-jigsaw@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:29 GMT