Hi,
habe noch nie so ein Fehler gesehen. Ich weiß auch nicht woran es liegt.
Fehler:
Wo es auftritt:
Die Methode:
habe noch nie so ein Fehler gesehen. Ich weiß auch nicht woran es liegt.
Fehler:
Code:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at db_Functions.InsertData.insertClientData(InsertData.java:67)
at clientContent.NewClient.btn_saveActionPerformed(NewClient.java:188)
at clientContent.NewClient.access$100(NewClient.java:16)
at clientContent.NewClient$2.actionPerformed(NewClient.java:123)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Wo es auftritt:
Code:
private void btn_saveActionPerformed (java.awt.event.ActionEvent evt)
{
// TODO add your handling code here:
String clientNumber = txtf_clientNumber.getText();
String lastname = txtf_lastname.getText();
String firstname = txtf_firstname.getText();
String street = txtf_street.getText();
String plz = txtf_plz.getText();
String ort = txtf_ort.getText();
String telnummer = txtf_telnummer.getText();
String handynr = txtf_handynr.getText();
String mail = txtf_mail.getText();
insData.insertClientData(clientNumber, lastname, firstname, street, plz, ort, telnummer, handynr, mail);
}
Die Methode:
Code:
public void insertClientData(String data1, String data2, String data3, String data4,
String data5, String data6, String data7, String data8, String data9)
{
this.table = table;
this.data1 = data1;
this.data2 = data2;
this.data3 = data3;
this.data4 = data4;
this.data5 = data5;
this.data6 = data6;
this.data7 = data7;
this.data8 = data8;
this.data9 = data9;
try
{
dbc.openDBConnection ();
String sql = "INSERT INTO Kunden (Kundennummer, Name,Vorname,Strasse, Postleitzahl, Wohnort, Telefonnummer, Handynummer, E-Mail) VALUES ('"+data1+"', '"+data2+"', '"+data3+"', '"+data4+"','"+data5+"', '"+data6+"', '"+data7+"', '"+data8+"', '"+data9+"');";
//int rowOfstate=state.executeUpdate (sql);
state.executeUpdate (sql);
}
catch(SQLException sqle)
{
String f = sqle.toString ();
//jop.showMessageDialog(null, f, jop.ERROR_MESSAGE);
sqle.printStackTrace ();
}
dbc.closeDBConnection ();
}
}