• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointerException on INSERT

 
Bob Backlund
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm pretty new to the whole SQL/Java thing, I'm trying to right a simple JSP/Servlet site. (well I thought it'd be simple)
Simply the user can enter some data into a set of fields on a JSP, this is then passed through a Sevler to another JSP. The Servlet is getting the data from the fields (I have System.out to show the data values) but the insert is failing with a java.lang.NullPointerException expection, even though all fields have a value in them and could accept a NULL value anyway.
The only thing I can think of, is i have a 'ID' field which is currently being left blank, however like i said it can have a NULL value so I don't think this should be a problem.
KPS
 
Nagendra Prasad
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure it is the insert that is throwing the NullPointerException? Are you sure it is not somewhere else in the code?
Best would be to inspect the stack trace? or post it here... I can take a look and offer my 2 pence worth of advice.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34074
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you by any chance trying to do this?

This is a commonly used invalid way of inserting null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic