wood burning stoves 2.0*
The moose likes JSP and the fly likes Null pointer Exception while inserting values in to DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Null pointer Exception while inserting values in to DB" Watch "Null pointer Exception while inserting values in to DB" New topic
Author

Null pointer Exception while inserting values in to DB

V Praveen
Greenhorn

Joined: Jun 02, 2008
Posts: 1
Hi All,
I am using tomcat 5.0.19 and oracle9i with thin driver.
Up on trying to insert form values of a JSP page in to DB I am getting null pointer exception.(The data is getting inserted but exception is coming)
Also I am facing the same problem while trying to retrieve values from a table that match a condition.(Duplicate user check)

My JSP page is not showing any out put.
In the console I am getting a null pointer exception message of the catch
block.
Please help me to solve this problem.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

First, if the code is in the JSP, refactor it to a separate class. This will only get you started following modern standards, it will make such problems much easier to diagnose.

The stack trace should tell you what line created the problem. Inspect that line to see how any of the references might be null.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Null pointer Exception while inserting values in to DB
 
Similar Threads
Redirecting to the JSP when validation error occurs
Null pointer exception reading from text file.
How to handl Null Values from Database
null pointer exceptiion
Get values from a servlet