aspose file tools*
The moose likes JDBC and the fly likes What wrong? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "What wrong?" Watch "What wrong?" New topic
Author

What wrong?

Rajiv Musunuru
Greenhorn

Joined: Mar 19, 2012
Posts: 13
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

Joined: Apr 04, 2006
Posts: 108

Its not a good practice to create connection in init() method. Read more here ..database connection in init() of servlet


Thanks,
Tushar (SCJP 1.5)
 
jQuery in Action, 2nd edition
 
subject: What wrong?