Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cursor not in ResultSet Proximity

 
Amit Punjwani
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
<code>
<%@page language="java" import=" java.sql.*; "%>
<%Connection con; Statement st=null;%>
<html>
<body>
<P> Opportunities<Table Border=1 CellPadding=0 Cellspacing=0>
<TR>
<TD> Last </TD>
<TR>
<TD> First </TD>
<TR>
<TD> Phone </TD>
</TR>
<%
Class.forName("com.ashna.jturbo.driver.Driver");
con=DriverManager.getConnection("jdbc:JTurbo://10.10.40.83/SFA_RG","sfa_notes","intranet");
st=con.createStatement();ResultSet columns=st.executeQuery("Select LAST,FIRST,PHONE from ContactTest");
while(columns.next());
{
String Last = columns.getString ("LAST");
String First = columns.getString ("FIRST");
String Phone = columns.getString ("PHONE");
%>
<TR>
<TD> <%= Last %> </TD>
<TD> <%= First %> </TD>
<TD> <%= Phone %> </TD>
/TR>
<%
}
%>
</Table>
</body>
</html>
</code>
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a semi-colon after your while statement. "while(columns.next());" remove it and see what happens.

Bosun
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic