Results 1 to 2 of 2
  1. #1
    bbq
    bbq is offline Senior Member
    Join Date
    Jun 2007
    Posts
    132
    Rep Power
    0

    Default statement null pointer exception

    I'm trying to fill a jtable with information from the data base


    Java Code:
    try {
               
            statement = connection.createStatement();
                Result = statement.executeQuery (con);
               
                while(Result .next()) {
                    data.addElement(Result.getString("user"));
                }
               
            } catch (SQLException sqlEx) {
                cargarDB.displayErroresSQL(sqlEx);
            } catch (NullPointerException nuloEx) {
                nuloEx.printStackTrace();
            } catch (Exception ex) {
                ex.printStackTrace();
            }
    I have this error:
    Java Code:
    java.lang.NullPointerException
            at org.gui.Deleteuser.<init>( EliminarUsuario.java:83)
            at org.gui.Main.actionPerformed(Main.java:180)
            at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
            at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
            at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
            at javax.swing.AbstractButton.doClick(Unknown Source)
            at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
            at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
            at java.awt.Component.processMouseEvent(Unknown Source)
            at javax.swing.JComponent.processMouseEvent(Unknown Source)
            at java.awt.Component.processEvent(Unknown Source)
      
    
            at java.awt.EventDispatchThread.pumpEvents (Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)
    any ideas?

  2. #2
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default

    You have a clearly error in line number 83. please paste code or check it

Similar Threads

  1. Null pointer Exception
    By peiceonly in forum New To Java
    Replies: 8
    Last Post: 09-05-2010, 07:48 PM
  2. Null pointer exception error
    By brownie_jedi in forum New To Java
    Replies: 3
    Last Post: 03-15-2008, 07:27 AM
  3. Replies: 1
    Last Post: 03-08-2008, 07:41 PM
  4. Help with if statement
    By carl in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 08:53 AM
  5. Statement or Prepared Statement ?
    By paty in forum JDBC
    Replies: 3
    Last Post: 08-01-2007, 05:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •