Geeks Talk

Prepare for your Next Interview




How to read a value from resultsetobjet

This is a discussion on How to read a value from resultsetobjet within the JSP forums, part of the Web Development category; 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 ...


Go Back   Geeks Talk > Web Development > JSP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-05-2007
Expert Member
 
Join Date: Feb 2007
Posts: 1,279
Thanks: 0
Thanked 164 Times in 138 Posts
Geek_Guest is on a distinguished roadGeek_Guest is on a distinguished road
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
Reply With Quote
The Following User Says Thank You to Geek_Guest For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 06-15-2007
Junior Member
 
Join Date: May 2007
Location: Bangalore
Posts: 19
Thanks: 0
Thanked 1 Time in 1 Post
sweet_person is on a distinguished road
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.
Reply With Quote
  #3 (permalink)  
Old 06-15-2007
Junior Member
 
Join Date: Apr 2007
Location: Chennai
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
vinotha is on a distinguished road
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;
}
}
Reply With Quote
Reply

  Geeks Talk > Web Development > JSP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Change attribute of a View to read only and editable Geek_Guest Seibel 0 04-03-2007 11:49 AM
Read all files as they arrive in directory and then process Geek_Guest Oracle 0 03-07-2007 06:34 AM
The Read/Write Web Lokesh M HTML & CSS 0 06-21-2006 12:58 AM
Software and Programs license - Must Read admin Downloads 0 05-24-2006 07:09 PM


All times are GMT -4. The time now is 02:02 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved