Hi, Jennifer

   you are not closing the resultset objects in your code, that can create a problem

   I just modified your code and it 's here try this and if you still get any problems 
let me know...


Code:
======================================================================
=========

   try{
    int idT=0;
    String passwordT=null;
    Statement statement =connection.createStatement();
    String query = "SELECT Id FROM Details " + "WHERE Password = '" + password + "'";
    String query1 = "SELECT Password FROM Details " + "WHERE Id = "+ id ;
    ResultSet rs = statement.executeQuery(query );
     if(rs.next())
           idT = rs.getInt("Id");
    rs.close();
   statement.close();//  close the statement once u finished using that.........

  // create the statement only when it is necessary
   Statement statement1 = connection.createStatement();

    ResultSet rs1 = statement1.executeQuery(query1 );
        if( rs1.next())
         passwordT = rs1.getString("Password");
     rs1.close();

                     statement1.close();
//  close the statement once u finished using that.........
           int x=0;
           int y=0;
           if(passwordT!=null){
            // here u should check for the null value, otherwise assign "" in the 
begining..
             x = passwordT.compareTo(password);
             y = Integer.parseInt(id);
           }

            if(x == 0 && idT == y){

                                output.println( "<H1><Font
color:Red>Welcome to our Online Service!</FONT><BR></H1>");
                        output.println(getServletInfo());

                        }

                        if(x > 0 ){
                                 output.println( "<H1><Font
color:Red>Incorrect Password!</FONT><BR></H1>");
                                output.println( "<BR><BR><H1><Font
color:Blue>Please click the, Back, button and try again!
</FONT><BR></H1>");
                        }

                        if(idT != y){
                                output.println( "<H1><Font
color:Red>Incorrect Id Entered!</FONT><BR></H1>");
                                output.println( "<BR><BR><H1><Font
color:Blue>Please click the, Back, button and try again!
</FONT><BR></H1>");
                        }



              }
======================================================================
==================
Code End.



    Hope this will help

Sateesh

___________________________________________________________________________
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