This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Cursor not in ResultSet Proximity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Cursor not in ResultSet Proximity" Watch "Cursor not in ResultSet Proximity" New topic

Cursor not in ResultSet Proximity

Amit Punjwani
Ranch Hand

Joined: Jul 10, 2000
Posts: 50
Hi guys,
Im have a small problem with the following code. When i run the following code, i get the error javax.servlet.ServletException "Cursor not in ResultSet Proximity
If anyone could help me with this it would be of great help
This is my code
<%@page language="java" import=" java.sql.*; "%>
<%Connection con; Statement st=null;%>
<P> Opportunities<Table Border=1 CellPadding=0 Cellspacing=0>
<TD> Last </TD>
<TD> First </TD>
<TD> Phone </TD>
st=con.createStatement();ResultSet columns=st.executeQuery("Select LAST,FIRST,PHONE from ContactTest");
String Last = columns.getString ("LAST");
String First = columns.getString ("FIRST");
String Phone = columns.getString ("PHONE");
<TD> <%= Last %> </TD>
<TD> <%= First %> </TD>
<TD> <%= Phone %> </TD>
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You have a semi-colon after your while statement. "while(;" remove it and see what happens.


So much trouble in the world -- Bob Marley
I agree. Here's the link:
subject: Cursor not in ResultSet Proximity
It's not a secret anymore!