aspose file tools
The moose likes JDBC and Relational Databases and the fly likes  Got Nullpointer Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark " Got Nullpointer Exception" Watch " Got Nullpointer Exception" New topic
Author

Got Nullpointer Exception

shiva mistry
Greenhorn

Joined: Feb 05, 2013
Posts: 10
When I try to insert student in Database I got an exception like Nullpointer Exception can any one help please ?






Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
In which line of code are you getting the exception? Post the entire stack trace.

Have you verified that "con" is not null? You didn't post code that assigns a value to "con".
shiva mistry
Greenhorn

Joined: Feb 05, 2013
Posts: 10
Ulf Dittmer wrote:In which line of code are you getting the exception? Post the entire stack trace.

Have you verified that "con" is not null? You didn't post code that assigns a value to "con".



Here is that code : I am getting an Exception at line 28

Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
So it's probably "con" that's null - that means you probably got a stack trace in line 18; correct?
shiva mistry
Greenhorn

Joined: Feb 05, 2013
Posts: 10
Ulf Dittmer wrote:So it's probably "con" that's null - that means you probably got a stack trace in line 18; correct?


Hi Ulf, I forgot to define con in default constructor now it's working Thanks..





 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Got Nullpointer Exception