Hi,

I'm trying to create a servlet that allows a user to log in to a
database. I know this is easy but the way in which I am trying to do
it is by having just one servlet/java code take in the username and
password and then this would be called by every servlet that needed to
connect to the database.

So far my code is this for the main login servlet.

import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class login {

        private String dbuser, user, password;

        public void dostuff (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
                HttpSession tsession=req.getSession(true);
                String role=req.getParameter("role");
                String user=req.getParameter("user");
                String passwd=req.getParameter("password");
        }
}//end

Is this all I need or do I actually need some more code in here.
And how do I call this in another servlet?

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to