File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes jsp errror found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jsp errror found" Watch "jsp errror found" New topic

jsp errror found

kanan devi

Joined: Oct 27, 2008
Posts: 9
im in java beginers,i have found this error
[Microsoft][SQLServer 2000 Driver for JDBC]Invalid operation for the current cursor position.
pliz tell me where is the mistake and how to solve it.
i have givn the stak trace here plize give me the solution

Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://logindatabase:1433","sa","smcc123");
Statement st3=conn.createStatement();
String sql3 = "SELECT * FROM news.dbo.polledresult";
ResultSet rs3=st3.executeQuery(sql3);;


<center><font color="#1010A5" size="2" face="Verdana, Arial, Helvetica, sans-serif">Last poll result</font></center>
<% if(question != null){%>
<font color="#1010A5" size="2"><%=question%></font>
<applet code="swiftchart.class" width="249" height="200">
<param name="chart_type" value="bar3d">
<param name="x_value" value="a,b,c,d">
<param name="s1_value" value="<%=as%>,<%=bs%>,<%=cs%>,<%=ds%>">
<param name="s1_label" value="poll">

catch(Exception ex)
System.err.println("Error: " + ex );
<% session.setAttribute("insertTag","false"); %>
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

your code is difficult to read.please use UBB code tag to post your coding part.
Mourouganandame Arunachalam
Ranch Hand

Joined: Oct 29, 2008
Posts: 396

It looks like you are not on a valid row or the result set might have closed. You should check what returns before accessing result set contents. next() will return false if you are not in a valid row.

Open Source leads to Open Mind
CharanZ Gowda

Joined: Oct 27, 2008
Posts: 1
when multipple sets of data is returned you need to use loops to retrieve the entire data.
Use 'While({}' instead of ';'
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Further, its not a good idea to do database stuff inside your JSP. If you are writing a test or something, then consider to use SQL tags.
ou yang

Joined: Oct 14, 2008
Posts: 10
what is your version of sql 2000 db.maybe your database is missing to install something .
I agree. Here's the link:
subject: jsp errror found
jQuery in Action, 3rd edition