Yag
Janeiro 18, 2012, 6:11pm
#1
E ai galera, acho que é um erro de sintaxe aqui:
yago.executeUpdate("update notas set (1parcial) = ('"+jTextField3.getText()+"') where (idnotas) = ('"+jTextField2.getText()+"')");
Olhem:
try{
Class.forName("com.mysql.jdbc.Driver");
Connection dioney = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/yago","root", "yago");
Statement yago = (Statement) dioney.createStatement();
yago.executeUpdate("update notas set (1parcial) = ('"+jTextField3.getText()+"') where (idnotas) = ('"+jTextField2.getText()+"')");
JOptionPane.showMessageDialog(null, "NOTA AUALIZADA");
jTextField3.setText("");
dioney.close();
}
catch(Exception e){
System.out.println("erroo");
}
Desde já agradeço a atenção
O correto é sem parenteses:
1. yago.executeUpdate("update notas set 1parcial = '"+jTextField3.getText()+"' where idnotas = "+jTextField2.getText());
tek
Janeiro 18, 2012, 7:37pm
#3
Buenas,
Cara se na tua tabela de nota, o campo 1parcial é float (contém vírgula) para realizar update no banco tem que substituir por .(ponto)
Acesse: www.tiagoek.com.br
Yag
Janeiro 18, 2012, 8:02pm
#4
Vou ver aqui ademilto,
tek, a coluna é do tipo double,
tek
Janeiro 18, 2012, 8:20pm
#6
Cara,
Se está funcionado sua connection, cria uma variavel do tipo String e seta com o Update que está realizando, faz um System.out.println dessa variavel para ver se copiando e colando direto no banco não acontece o erro, ou os valores do teus textfields não estão com o valor correto.
Se tiver apresentando algum erro coloca a imagem ai.
Acesse: www.tiagoek.com.br
Yag
Janeiro 18, 2012, 8:45pm
#7
yago.executeUpdate("update notas set 1parcial = "+jTextField3.getText()+" where (idnotas) = ('"+jTextField2.getText()+"')");
Concegui é so faze isso.
Yag
Janeiro 18, 2012, 8:46pm
#8
tek, obrigado pela atençao kra