Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What wrong?

 
Rajiv Musunuru
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to implement a hit counter.
I am using Oracle 11g xe, Eclipse IDE.
I created a table count with single column hit_counter. created a row with hit_counter = 0

I put ojdbc6.jar in web-inf/lib folder from what i read in the internet. I am getting nullpointerexception when I run the following servlet:

and the jsp code for hitdisplay.jsp as used in RequestDispatcher

This is the first time I am using jdbc api. I am stuck. Please help.
 
T Mishra
Ranch Hand
Posts: 108
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not a good practice to create connection in init() method. Read more here ..database connection in init() of servlet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic