A
Amateur2007
Gast
Dies wird in Eclipse in der Console ausgegeben, wenn ich daten in meine datenbank speichern möchte.
1. Klasse BenutzerGUI.java:113:
datenbankmethoden.einfuegen(); <-- wird aufgerufen um die eingaben zu speichern.
2. Klasse:
oder liegt der Fehler ganz wo anderst? Über eure Hilfe würde ich mich freuen.
Code:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at medienverwalter.BenutzerGUI$2.actionPerformed(BenutzerGUI.java:113)
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.plaf.basic.BasicButtonListener.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.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
1. Klasse BenutzerGUI.java:113:
datenbankmethoden.einfuegen(); <-- wird aufgerufen um die eingaben zu speichern.
2. Klasse:
Code:
public void einfuegen()
{
String titel = null;
String regisseur = null;
int spielzeit = 0;
try {
StringBuffer s = new StringBuffer();
s.append("insert into dvd ( titel, regisseur,spielzeit)VALUES (");
s.append(titel);
s.append(",'");
s.append(regisseur);
s.append("',");
s.append(spielzeit);
s.append(")");
Statement statement = (Statement) con.createStatement();
statement.executeUpdate(s.toString());
statement.close();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
oder liegt der Fehler ganz wo anderst? Über eure Hilfe würde ich mich freuen.