This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What wrong?