Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to validate username from MySql with JSP
- un//be the variable where username entered now from html form is stored
- uname //column name in mysql for usernames
- user //table name in mysql
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost/mebps","root","admin");
- Statement stmt = (Statement) con.createStatement();
- ResultSet rs = stmt.executeQuery("select un from userinfo");
- while(rs.next())
- {
- if(rs.getString("uname") == un)
- {
- out.println("user is present");
- }
- }
Add Comment
Please, Sign In to add comment