This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, In the below jsp page, i am retrieving the data from drop down list of adduser.jsp page .but showing the error like: javax.servlet.ServletException: java.sql.SQLException org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850) The error showing is at marked line. Here is an code:
Here try this code instead of yours.. The code that you highlighted seems to be not good..You must use rs.next() inorder to fetch values from DB...But where you do it?...Please do read more about JDBC and correct way to use it...
Also read the article in this -LINK- . It may be very helpful to you Harshal... [ July 11, 2008: Message edited by: Rajkumar balakrishnan ]
Never try to be a hard-worker. Be a smart-worker.
This marked line reads from the ResultSet before you call rs.next() and hence results in an Exception. Even to read the first fetched record, you have to call rs.next() to move the cursor to the first record.
By the way, I see that you call rs.getString("userid") and rs.getString("EMAIL") later in the code, but where are you fetching them?
Hi but i am using drop down list name(form1) as reference from the previous jsp page(searchuser.jsp) to retrive data from table i.e suppose i selected abc user as option in drop down list in searchuser.jsp page, i am expecting to get data related to that abc user in table in updateuser.jsp page .And accordingly i marked quary as: now my page displaying the result as jsp tag %> Any suggestion is highly appreciated. Thanks and Regards Harshal
Will you put your modified code here.So we can answer effectively..If you still not modify the code it's hard to give you the answer..
Joined: May 29, 2008
Hi Rajkumar, Thanks very much for your helping attitude.I want hertly appreciate your suggestion. Now I am enclosing both jsp pages i.e 1. searchuser.jsp where moderator can select name of particular employee from drop down list and after submitting this page, in the next page i.e updateuser.jsp i will get all the details of employee like here email and password. My next aim is updating all detail of employee I can feed the updated date into the table: Here is searchuser.jsp:
And here is an updateuser.jsp:
Kindly Suggest me Required modification. Thanks and Regards Harshal
The way you print is wrong..You already fetch the data from DB and store it in variable name EMAIL and PASSWORD..so you must print them in the Table or whatever else. So change your code like this..
<input type=text value="<%=EMAIL%>">
and for password just replace EMAIL with password in the above code... Hope this might help you.. You need to learn more about JDBC that's what i suggest you from your earlier post itself.. [ July 11, 2008: Message edited by: Rajkumar balakrishnan ]
By looking at your recent posts (which are almost similar in the forums), you can better take some time off to study the JDBC concepts and tutorial. It will really help you and facilitate you to proceed further without any hassles.
Hi Raghavan, As You suggested code cause my jsp page is running dut showing output as jsp syntax as %> How can display this data in table form. I think my code inside the table is not working. Kindly update me. Thanks Regards Harshal [ July 11, 2008: Message edited by: Harshal Gurav ]
Wouldn't you try the code that i post here...? Please do read some tutorials and please check your JSP file line by line which may helpful to you in time..
Joined: May 29, 2008
Hi Rajkumar,Raghavan Thanks for your Suggestion. I am Definately follow The Instruction as you suggest me. I want to just know whether it is possible to display the data in updateuser.jsp page I tabular format which is related to the option selected in searchuser.jsp page. Regards Harshal
Yes it's possible..You can display it in whatever format you want.. Your code seems to be ok and with the code and instructions that we gave itself will solve your problem. You still experience any problem with your code...huh...Then let us know about it clearly..