This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Greetings!!! I have listing.jsp where i display all the records from the DB. JOBCODE is displayed as a link and onClick is calling detail.jsp?par=somenumber, so i am passing par=111 to a detail.jsp. This page fetches passed jobcode and it supposed to bring all the details for that jobcode that are in DB. However that is not happening. Error i am getting is javax.servlet.ServletException: [Microsoft][ODBC Driver Manager] Invalid cursor state Below is the detail.jsp. Same error occurs even if i hardcode jobcode. Hopefully someone can help me out. Sorry if i am not clear enough. It's 2:30 AM, and my eyes are leaking out. <%@ page language = "java" import = "java.sql.*" %>
Your error message is coming from the Microsoft ODBC driver. The JDBC-ODBC bridge isn't thread-safe, so that MIGHT be your problem. Then again, if I really wanted to inflict pain on someone, I'd make them work with ODBC at 2am even without Java !
An IDE is no substitute for an Intelligent Developer.
Joined: Mar 07, 2001
Thank you Tim. One way or the other but i got it to work somehow. m, phx
The first row in a ResultSet is always empty. When you want to retrieve the results from a select returning a single result you have to make sure it has returned at least one result by attempting to push the cursor forward:
Same for a query that return multiple rows except that you use while instead of if. Dave.