
Hi While trying to execute the below code i'm getting the following error "java.sql.SQLException: Io exception: Got minus one from a read call ". please help me out.
<%
try{
String Username=request.getParameter("username");
String Password=request.getParameter("password");
session.setAttribute("myusername", Username);
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:8084:dsn","system","tiger");
Statement st=null;
PreparedStatement ps=null;
ps=con.prepareStatement("select * from Users where USERID=? and PASSWORD=?");
ps.setString(0, Username);
ps.setString(1, Password);
ResultSet rs=null;
rs=ps.executeQuery();
if(rs.next()){
String redirectURL= "New.html";
response.sendRedirect(redirectURL);
}
else{
out.println("no login");
}
}
catch(Exception e){
out.println(e);
}
%>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.