A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Databases
»
JDBC
Author
Invalid cursor state
jan frank
Greenhorn
Joined: Jul 31, 2005
Posts: 5
posted
Aug 02, 2005 01:50:00
0
Hi,
Any suggestions & solutions about this elusive error message? [Microsoft][ODBC Driver Manager] Invalid cursor state.
This is the bit of code that gives that error:
<table border ="3" width = "50%"> <tr> <td width = "20%"> <img src="images/multipic.jpg" width="227" height="170"></td> <td width = "80%"> <% String sql1 = "SELECT tblHomePage.welcome_note FROM tblHomePage"; Connection con1 = null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con1 = DriverManager.getConnection("jdbc :-o dbc:IVES","",""); Statement stmt1 = con1.createStatement(); ResultSet rs1 = stmt1.executeQuery(sql1); %> <% while (rs.next()) { System.out.println(rs1.getString("welcome_note")); } %> <% rs1.close(); //close the resultset }//end of try catch(SQLException e) { out.println(e.getMessage()); } %> </td> </tr> </table>
Thanks
David O'Meara
Rancher
Joined: Mar 06, 2001
Posts: 13459
I like...
posted
Aug 02, 2005 03:08:00
0
while (rs.next()) {
System.out.println(rs1.getString("welcome_note"));
}
Which result set are we referring to?
jan frank
Greenhorn
Joined: Jul 31, 2005
Posts: 5
posted
Aug 03, 2005 18:48:00
0
oops! the resultset should have been rs1 not rs.
I resolved the problem
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Invalid cursor state
Similar Threads
two dropdown menus
jsp:compare select statement error
Help with JSP Page
I M NOT ABLE TO DEFINE VARIABLES IN JSP.
Error in rs
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter