• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Update query not getting executed in jsp  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am designing a attendance system. I am facing problem in the execution of update query. This is the code:

att.jsp




test1.jsp



In test1.jsp the last update statement is not getting executed, it is working without the where condition. The out.println statement is also printing the correct value. plzz help me with it.
 
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, first off, none of that Java code should be in those pages.
They should be in a servlet.  For some of it (the database access parts at least) they should be in a service class called by a servlet.

JSP pages are for displaying things, not doing the work.

Once that's done you'll find it a lot easier to test the code, and to debug it.
 
Pur Bh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will do that, thankyou. but can you please tell me is there anything wrong with the update query in test1.jsp
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you say it's not being executed then the only thing would be that sports.length is 0.
That's the only way the query won't run.

If this was in a normal Java class you'd be able to debug it.
 
Dave Tolls
Master Rancher
Posts: 4042
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, re-reading your first post, it is running.
It's just not updating anything.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!