if (firstName.equals("")) {
errors.put("firstName", "Please enter your first name");
firstName = "";
allOk = false;
} else {
String expression1 = "^[!,@,#,$,%,^,&,*,(,)]+$";...
Type: Posts; User: surendran610
if (firstName.equals("")) {
errors.put("firstName", "Please enter your first name");
firstName = "";
allOk = false;
} else {
String expression1 = "^[!,@,#,$,%,^,&,*,(,)]+$";...
my question is "How to validate the existing username in database?"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page...
String username=request.getParameter("username");
ResultSet rs=st.executeQuery("select * from regis where username='"+username+"'");
if(rs.next() ){
response.sendRedirect("register.jsp");...
i found that error. we have to insert this one unless the database will not auto increment
ps.setObject(1,null);
Statement stm=con.createStatement();
PreparedStatement ps=conn.prepareStatement("insert into regis values(?,?,?,?,?,?,?,?,?,?)");
ps.setString(2, username);
ps.setString(3, password);...