PDA

View Full Version : java.lang.nullpointerexception error :(




suarda
Dec 24, 2011, 02:32 PM
i'm working on an application on netbeans. when i click run it opens but when i click on a button for example to insert some data on database (mysql) is says java.lang.nullpointerException. i don't know how to solve it.. :( please somebody help me :confused:



ftored
Dec 24, 2011, 04:41 PM
From the back of my headi would try these:

Have you checked that you have connected correctly to the database? I mean the connection string and everything is ok?

The parameters you pass to the command for running the query for inserting are ok?

Try to check if the sql query you create for inserting is fine and/or it gets the data from the textboxes on screen correctly.

jettoblack
Dec 24, 2011, 05:22 PM
The Java interpreter should tell you which class and what line of the source code is generating the exception. Take a look at that line and figure out why one of the objects involved is set to null instead of an instance of the object.

That's the most anyone can tell you without seeing the code.