Results 1 to 3 of 3

Thread: How to read a value from resultsetobjet

  1. #1
    Geek_Guest
    Guest

    How to read a value from resultsetobjet

    Hi,

    I have a doubt in servlet, How to read a value from resultsetobjet which is coming from database to textfield.

    When we select one value from drop-down list the corresponding value will be displayed in corresponding textfield automatically. I need code in servlets

    Question asked by visitor swapna.s


  2. #2
    Junior Member
    Join Date
    May 2007
    Answers
    19

    Re: How to read a value from resultsetobjet

    sorry man i couldnt understand your problem. please explain your problem in eloborated manner, so that i can come with answer.


  3. #3
    Junior Member
    Join Date
    Apr 2007
    Answers
    15

    Re: How to read a value from resultsetobjet

    Hi,

    try this.for eg consider u want to access the field salaray from employee table.
    and u r sending empid through request.u r gettign the empid from the dropdown table .consider salary is the second field in employee table.

    String result=null;
    try
    {
    Class.forName("url");
    Connection conn=Drivermanager.getConnecction("url");
    Statemetn stmt=conn.createStatement();
    ResultSet rst=stmt.executeQuery("select * from employee where userId = " +(request.getParameter("userID"));
    result= rst.getString(2);
    }
    catch(SQLExceptione){
    return result;
    }
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact