I think instead of calling like
 String id = rs.getString( 1);  //get userID (email address)
 String pw = rs.getString( 2);  //get password
call it like
String id = rs.getString("name of the DB field");  //get userID (email
address)
 String pw = rs.getString("name of the DB field");  //get password

Thanks & rgds
Arijit

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Mark
Galbreath
Sent: Thursday, December 27, 2001 5:33 PM
To: [EMAIL PROTECTED]
Subject: Session Attribute Problem


Can anybody give me a clue as to why I am getting null pointer exceptions
when I access userID, password, or minit from a JSP page but not fname,
lname or accesslevel?

while( rs.next()) {
    String id = rs.getString( 1);  //get userID (email address)
    String pw = rs.getString( 2);  //get password

    if( parmUserid.equalsIgnoreCase( id) && parmPW.equalsIgnoreCase( pw)) {
        String fname = rs.getString( "fname");
        String minit = rs.getString( "minit");
        String lname = rs.getString( "lname");
        String accesslevel = rs.getString( "accesslevel");

        session.setAttribute( "userID", id);
        session.setAttribute( "password", pw);
        session.setAttribute( "fname", fname);
        if( minit != null) { session.setAttribute( "minit", minit); }
        session.setAttribute( "lname", lname);
        session.setAttribute( "accesslevel", accesslevel);
...

Thanks,
Mark

___________________________________________________________________________
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

___________________________________________________________________________
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