• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp project

 
ritesh srivastav
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to to create a jsp page where it count the user hits and save in database.......i hve tried to write tht code but its nt work.

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While you didn't say how it's not working (what is it supposed to do, and what does it do instead, and what have you done so far to debug the issue), a few things jump out.

#1 - You absolutely, positively should not declare Java classes in JSPs. Put those classes into WEB-INF/classes where they belong.

#2 - All DB code that does anything seems to be commented out. The code tags I added to your post make that easy to see (please UseCodeTags in the future when you post code of any length).

#3 - What's with the threads? Should the DB operations not be carried out out right away? But regardless of what it is supposed to do, it almost certainly won't work the way you hope it will work; best to get rid of all that.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a lot more to criticize in that code. I would suggest you extract it from that JSP -- where as already said, it doesn't belong -- and post it in one of the Java forums. I would just start by pointing out this:



Don't do that. When exceptions are thrown, you won't know about them and you will just have unexplained behaviour.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic