This is the code I'm using to isert record in SQL but it produced the "ResultSet error not produced" and even it did not inserted the mobile field, but the field is set to "not null" still it was showing null.
Code:
<% try { String n=request.getParameter("name"); String u=request.getParameter("uname"); String p=request.getParameter("pwd"); String y=request.getParameter("Year"); String g=request.getParameter("Gender"); String e=request.getParameter("EmailID"); String c=request.getParameter("Moblie"); String a=request.getParameter("Address"); Connection con=DriverManager.getConnection("jdbc:odbc:uinfo; uid=System; pwd=tandon"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("insert into uinfo values('"+n+"','"+u+"','"+p+"','"+y+"','"+g+"','"+e+"','"+c+"','"+a+"');"); if(rs.next()) { %> <jsp:forward page="U_Login.jsp" /> <% } else { out.println("please retry"); %><br><br> <a href="http://bytes.com/SignUp.jsp">Back to Home</a> <% } con.close(); } catch(Exception e) { out.println(e); } %>
Comment