i am making a project using jsp and i am stuck with the signup page
i want the user to enter its username , password, re enter password and a security question plz can any one provide me with the code or something
i shall be very very thakful to u. i really need it badly as i have to show it in my college day after tommorrow help will be greatly appreciated
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page language="java" import="java.sql.*;" %>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<%
try
{
String UserId = request.getParameter("Rexmail Id:");
String Password = request.getParameter("Password");
String Password1 = request.getParameter("Re-type Password");
String Answer = request.getParameter("Security Question");
String Answer1 = request.getParameter("Your Answer");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =DriverManager.getConnection("jdbc:odbc:pubs");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from CustomerRegister");
while(rs.next())
{
String username=rs.getString ("UserId");
if(username.equals(UserId) )
{
out.println("Account with same username exists");
}
}
if(Password.equals(Password1))
{out.println("kk");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con1 =DriverManager.getConnection("jdbc:odbc:pubs");
Statement s1=con1.createStatement();
s1.executeUpdate("Update CustomerRegister set UserId='"+UserId+"' and Password='"+Password+"'and Answer='"+Answer+"'and Answer1='"+Answer1+"'");
out.println("account created");
}
else
{
out.println("Passwords doesnot match");
}
}
catch(Exception e)
{
out.println(e);
}
%>
thats the jsp page which is connected to the datbase
and a html page in which user inputs username , password security question all that
but i am receiving errors can u help
it compiles but gives me a lang.java null pointer exception i have seached about this exception and tried to rectify but was unsuccessful