Ayuda :
Tengo el Siguiente Codigo: Que es para insertar
void jButton2_actionPerformed(ActionEvent e) {
try {
String snombre = String.valueOf(nombre.getText());
String sedad = String.valueOf(edad.getText());
String sdni = String.valueOf(dni.getText());
int nsuma = Integer.parseInt(suma.getText());
Connection c;
PreparedStatement ps;
String str = "jdbc:odbc:PEMPLEADO2";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c = DriverManager.getConnection(str);
ps = c.prepareStatement("Insert Into EMPLEADO(nombre,edad,dni,pa)values(?,?,?,?)");
ps.setString(1, snombre);
ps.setString(2, sedad);
ps.setString(3, sdni);
ps.setInt(4, nsuma);
ps.executeUpdate();
ps = c.prepareStatement("Select nombre,edad,dni,pa from EMPLEADO where not exists(Select nombre,edad,dni,pa from EMPLEADO where nombre='"+snombre+"' and edad='"+sedad+"' and dni='"+sdni+"' and pa='"+nsuma+"')");
ps.executeUpdate();
}
catch (Exception es2) {
es2.printStackTrace();
System.exit(0);
}
}
Me sale el siguiente Error:
java.sql.SQLException: No row count was produced
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpd ate(JdbcOdbcPreparedStatement.java:144)
at sintitulo6.Marco1.jButton2_actionPerformed(Marco1. java:360)
at sintitulo6.Marco1_jButton2_actionAdapter.actionPer formed(Marco1.java:713)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.act ionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.jav a:5100)
at java.awt.Component.processEvent(Component.java:489 7)
at java.awt.Container.processEvent(Container.java:156 9)
at java.awt.Component.dispatchEventImpl(Component.jav a:3615)
at java.awt.Container.dispatchEventImpl(Container.jav a:1627)
at java.awt.Component.dispatchEvent(Component.java:34 77)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3128)
at java.awt.Container.dispatchEventImpl(Container.jav a:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606 )
at java.awt.Component.dispatchEvent(Component.java:34 77)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 456)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:100)