File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes What wrong? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "What wrong?" Watch "What wrong?" New topic

What wrong?

Rajiv Musunuru

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

Tushar (SCJP 1.5)
I agree. Here's the link:
subject: What wrong?
It's not a secret anymore!