When the following JSP is executed.. it is giving error
500
"javax.servlet.ServletException: Exhausted Resultset" in tomcat
but there r records in my database...but error is saying Exhausted
Resultset...
Here is my jsp code... plz help me.....
<html>
<body>
<%@ page import="java.sql.*,java.io.*" %>
<%
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con
=
DriverManager.getConnection
("jdbc:oracle:thin:@suresh:1521:orcl","scott","tiger");
String username=request.getParameter("username");
String psw=request.getParameter("psw");
if(session.isNew())
{
session.setAttribute("username",username);
session.setAttribute("psw",psw);
}
PreparedStatement ps = con.prepareStatement("select psw from
users");
ResultSet rs = ps.executeQuery();
//ps.setString(1,username);
ResultSetMetaData rsmd = rs.getMetaData();
int count = rsmd.getColumnCount();
String ret=new String();
rs.next();
ret=rs.getString(1);
if(psw.equals(ret))
{
%>
<h1>Welcome <%= username %>... </h1>
<%
}
else
{
response.sendRedirect("error.html");
}
%>
</body>
</html>