Prepare for your Next Interview
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 ...
|
|||
|
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 |
| The Following User Says Thank You to Geek_Guest For This Useful Post: | ||
| Sponsored Links |
|
|||
|
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; } } |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| 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 |