I am trying to make a Social network site where a user can log or register. Once logged in with correct credentials, the user could search in a friends list and invite him/her to be friend.
So far I have made 2
jsp files-
[1] index.jsp [2] UserRegistration.jsp
and HttpServlets-UserLogIn and RegistrationServlet
The Dynamic project gets connected through
Tomcat using
JDBC 5.1.23 to mySQL database.
schema is SocialNetwork with 2 tables:
My index.jsp in webContent folder is:
my UserRegistration JSP is
userLogIn
servlet is:
RegistrationServlet is :-
I am not clear about the inserting data in to the DataBase and connection.
How could I connect the UserLogin servlet to the UserInfo table so that if the user’s name and password are found and matched in the DB , he could see his/her friends’ list.
If that username and password is not found in the UserInfo, a message should display that the user has to Register first.
Once the user is logged-in, he should see a list of all the Usernames and Age.
Later, the user could select a user from that list and invite that user to be his/her friend.
Right now I am getting attributes added to userInfo table in username and userPW columns:[ serial# is th PK] when the user Register on RegistrationServlet: