Tengo un problema, estoy intentando hacer un update de un campo de una BBDD en acces. El problema radica en que me tira error y no sé porque, imprimo la sentencia por pantalla y la ejecuto en acces y me funciona. Estoy un poco deseperado....
Les adjunto el metodo por si me pueden ayudar:
Código:
Y el error que sale es:public void actualitzarOrigen(String nomOrigen, String observacions, boolean actiu, int idO){ try { connectarBD(); this.query = "UPDATE origen SET nomOrigen ='" + nomOrigen + "', origen_Actiu =" + actiu + ",observacions ='" + observacions +"' WHERE idOrigen =" + idO; instruccio = con.createStatement(query); int a = instruccio.executeUpdate(query); instruccio.close(); desconnectarBD(); } catch (SQLException ex) { Logger.getLogger(cAcces.class.getName()).log(Level.SEVERE, null, ex); } }
Código:
Alguna sugerencia?28-ene-2012 18:49:33 Classes.cAcces actualitzarOrigen GRAVE: null java.sql.SQLException: Driver does not support this function at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:164) at Classes.cAcces.actualitzarOrigen(cAcces.java:539) at GUI.origens.btn_actualitzarRegistreActionPerformed(origens.java:443) at GUI.origens.access$400(origens.java:26) at GUI.origens$8.actionPerformed(origens.java:297) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2475) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178) at java.awt.Dialog$1.run(Dialog.java:1045) at java.awt.Dialog$3.run(Dialog.java:1097) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Dialog.show(Dialog.java:1095) at java.awt.Component.show(Component.java:1563) at java.awt.Component.setVisible(Component.java:1515) at java.awt.Window.setVisible(Window.java:841) at java.awt.Dialog.setVisible(Dialog.java:985) at registre_temperatures.Registre_TemperaturesView.btn_origensActionPerformed(Registre_TemperaturesView.java:280) at registre_temperatures.Registre_TemperaturesView.access$100(Registre_TemperaturesView.java:22) at registre_temperatures.Registre_TemperaturesView$2.actionPerformed(Registre_TemperaturesView.java:119) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2475) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Agradezco vuestra ayuda
Saludos