Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

suarda

macrumors newbie
Original poster
Sep 27, 2011
5
0
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

macrumors regular
Dec 29, 2005
135
1
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

macrumors member
Nov 1, 2006
70
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.