RSS Forums RSS
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 779 | Replies: 2 | Thread Tools  Display Modes
Reply
Join Date: Sep 2005
Posts: 12
Reputation: md_salman is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
md_salman md_salman is offline Offline
Newbie Poster

JSP and JDBC

  #1  
Jun 28th, 2007
I am writing a web based application using JSP and JDBC. In side a servlet I execute some code like this

DAO.addComments( commentsBean ); 
commentsList = DAO.getComments(); 
session.setAttribute( "comments", commentsList ); 
response.sendRedirect( "comments.jsp" ); 

when I move to comments.jsp I find all the comments except those that have been just added by the servlet code written above using addComments(). The next time I access the same page "comments.jsp" that missing comments appear.

The same problem occurs when I delete some comments, the deleted comments still appear on the comments.jps page when I visit the page just after deleting the comments form inside the servlet by calling the DAO method.

So many thanks if someone could guide me properly, about what is the issue (problem).

Good Bye.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,174
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 26
Solved Threads: 396
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: JSP and JDBC

  #2  
Jun 28th, 2007
Offhand it would be difficult to point out the actual cause of your application _not working_ but I guess the collection used to hold values is not getting updated or the DAO methods are returning rogue values in your case. Without more code, I don't think anyone would be as such able to lend a helping hand.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Join Date: Jul 2007
Posts: 2
Reputation: sam.n is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sam.n sam.n is offline Offline
Newbie Poster

Re: JSP and JDBC

  #3  
Jul 1st, 2007
Hi
are u executing your code for fetching the comments in a separate thread inside this method?
DAO.getComments();

If yes..try removing thread.

I am not sure how you are implementing DAO....just a wild guess though.

Regards
sam.n
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the JSP Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:53 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC