Ragazzi sto uscendo pazzo... Mi da' errore di sintassi in una query di update...
Questo è cio' che stampa la println e l'errore ....codice:private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String cod = txt_cod.getText(); String des = txt_des.getText(); Double luc = Double.parseDouble(txt_luc.getText()); Double mef = Double.parseDouble(txt_mef.getText()); Double alt = Double.parseDouble(txt_alt.getText()); Connection conn; final String URL = "jdbc:mysql://localhost:3306/general electric?user=root&password=rapaic"; String SQL; try{ conn = DriverManager.getConnection(URL); SQL = "UPDATE materiale SET Codice = '" +cod+ "' , Descrizione = '" +des+ "' , Prezzo Lucciola = " + luc + " , Prezzo Meff = " + mef+ " , Prezzo Altri = "+alt+" WHERE Descrizione = '"+it+"'"; System.out.println(SQL); Statement statement = conn.createStatement(); statement.executeUpdate(SQL); conn.close(); } catch (Exception ex) { System.out.println(ex.getMessage()); } }
data.jpgcodice:UPDATE materiale SET Codice = 'dfjg' , Descrizione = 'asiudfhosdjf' , Prezzo Lucciola = 3.0 , Prezzo Meff = 3.0 , Prezzo Altri = 2.0 WHERE Descrizione = 'dfjg' You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Lucciola = 3.0 , Prezzo Meff = 3.0 , Prezzo Altri = 2.0 WHERE Descrizione = 'dfj' at line 1 BUILD SUCCESSFUL (total time: 1 minute 8 seconds)
Questo è il database...
Aiuto!


Rispondi quotando
beh si è questo... Il database l'ho creato con phpMyAdmin... 
