aspose file tools*
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Cursor not in ResultSet Proximity" Watch "Cursor not in ResultSet Proximity" New topic
Author

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
<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

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

Bosun

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cursor not in ResultSet Proximity
 
Similar Threads
delete tag
web application in eclipse 9
Servlet getting values from a combo box
error 500 in JSP
two dropdown menus