При обновлении любых данных любого поля это выдает ошибку типа:
Драйвер загружен
инструкция создана
java.sql.SQLException: Общая ошибка
at sun.jdbc.odbc.JdbcOdbc.createSQLException (JdbcOdbc.java:6986)
at sun.jdbc.odbc.JdbcOdbc.standardError (JdbcOdbc.java:7114) * 100dbc.bb,(sanskarwani.java:2792) в sanskarwani.access $ 700 (sanskarwani.java:29) в sanskarwani $ 8.actionPerformed (sanskarwani.java:1255) в javax.swing.AbstractButton.fireActionPerformed (AbstractButton.java at1995).AbstractButton $ Handler.actionPerformed (AbstractButton.java:2318) в javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387) в javax.swing.DefaultButtonModel.setPressed (DefaultButtonModel.java: 242) в javax.swing.plaf.basic.BasicButtonListener.mouseReleased (BasicButtonListener.java:236) в java.awt.AWTEventMulticaster.mouseReleased (AWTEventMulticaster.java:272) в java.awt.Momponent.: 6038) в javax.swing.JComponent.processMouseEvent (JComponent.java:3260) в java.awt.Component.processEvent (Component.java:5803) в java.awt.Container.processEvent (Container.java:2058) в java..awt.Component.dispatchEventImpl (Component.java:4410) в java.awt.Container.dispatchEventImpl (Container.java:2116) в java.awt.Component.dispatchEvent (Component.java:4240) в java.awt.light .weightretargetMouseEvent (Container.java:4322) в java.awt.LightweightDispatcher.processMouseEvent (Container.java:3986) в java.awt.LightweightDispatcher.dispatchEvent (Container.java:3916) в java.awt.Container.dmpl: 2102) в java.awt.Window.dispatchEventImpl (Window.java:2429) в java.awt.Component.dispatchEvent (Component.java:4240) в java.awt.EventQueue.dispatchEvent (EventQueue.java:599) по адресу java.awt.EventDispatchThread.pumpOneEventForFilters (EventDispatchThread.java:273) по адресу java.awt.EventDispatchThread.pumpEventsForFilts.ventDefThisPhatch.jpg.java: 173) в java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:168) в java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:160) в java.awt.EventDispatchThj:p:
Мой код:
String nmreg = cbnm.getSelectedItem().toString();
if(nmreg.equals("")) //{
JOptionPane.showMessageDialog(null," ENTER THE NAME ");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("\n Driver loaded");
Connection con = DriverManager.getConnection("jdbc:odbc:wanisamajDB");
Statement stmt = con.createStatement();
System.out.println("statement is created");
String qry = " UPDATE Registration1 set RegistrationNo = '"+cbregn.getSelectedItem()+"',SeniorPerson = '"+cbnm.getSelectedItem()+"', NativePlace = '"+tfplace.getText()+"',Kul = '"+tfkul.getText()+"', Gotra = '"+tfgotra.getText()+"' ,KulSwami = '"+tfswami.getText()+"', ResidensialAddress = '"+taraddr.getText()+"' , PinCode = '"+tfpcd.getText()+"', STDcode = '"+tfstdcode.getText()+"',TelephoneNo = '"+tftele.getText()+"', MobileNo = '"+tfmno.getText()+"', Email = '"+tfemail.getText()+"',Website ='"+tfweb.getText()+"',Education ='"+tfedu.getText()+"',Branch ='"+tfbrch.getText()+"',BloodGroup ='"+cbbldgrp.getSelectedItem()+"' where SeniorPerson='" +cbnm.getSelectedItem().toString()+"'" ;
// String qry= " UPDATE Registration1 set SeniorPerson = '"+cbnm.getSelectedItem().toString()+"',NativePlace = '"+tfplace.getText()+"', Kul = '"+tfkul.getText()+"',Gotra = '"+tfgotra.getText()+"' , KulSwami = '"+tfswami.getText()+"', ResidensialAddress = '"+taraddr.getText()+"' , PinCode = '"+Integer.parseInt(tfpcd.getText())+"', STDcode = '"+Integer.parseInt(tfstdcode.getText())+"',TelephoneNo = '"+Integer.parseInt(tftele.getText())+"',MobileNo = '"+Integer.parseInt(tfmno.getText())+"',Email = '"+tfemail.getText()+"',Website ='"+tfweb.getText()+"',Education ='"+tfedu.getText()+"',Branch ='"+tfbrch.getText()+"',BloodGroup ='"+cbbldgrp.getSelectedItem().toString()+"' where RegistrationNo='" +Integer.parseInt(cbregn.getSelectedItem().toString())+"'" ;
stmt.executeUpdate(qry);
JOptionPane.showMessageDialog(null,"RECORD IS UPDATED SUCCESSFULLY ");
System.out.println("QUERY");
// cbregn.setEditable(false);
cbnm.setEditable(false);
tfplace.setEditable(false);
tfkul.setEditable(false);
tfgotra.setEditable(false);
tfswami.setEditable(false);
taraddr.setEditable(false);
tfpcd.setEditable(false);
tfstdcode.setEditable(false);
tftele.setEditable(false);
tfmno.setEditable(false);
tfemail.setEditable(false);
tfweb.setEditable(false);
tfedu.setEditable(false);
tfbrch.setEditable(false);
cbbldgrp.setEditable(false);
con.close();
stmt.close();
}
// catch(SQLException eM)
// {
// JOptionPane.showMessageDialog(null,"RECORD IS NOT FOUND ");
// }
catch(Exception et)
{
et.printStackTrace();
// System.out.println("error:"+et.getMessage());
}
помогите мне, пожалуйста