java.lang.nullpointerexception error :(

Discussion in 'Mac Programming' started by suarda, Dec 24, 2011.

  1. suarda macrumors newbie

    Sep 27, 2011
    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:
  2. ftored macrumors regular


    Dec 29, 2005
    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.
  3. jettoblack macrumors member

    Nov 1, 2006
    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.

Share This Page