1
try{
Class.forName(driver);
Connection conn = DriverManager.getConnection(str_conn, usuario, senha);
Statement stmt = conn.createStatement();
String sqlinsert ="insert into cheque (data_cheque,valor,repasse) values ("+
jTextField1.getText()+","+
jTextField2.getText()+",' "+
jTextField3.getText()+" ') ";
stmt.executeUpdate(sqlinsert);
JOptionPane.showMessageDialog(null,"Sucesso");
}
catch (ClassNotFoundException ex) {
System.out.println("Não foi possível carregar o driver.");
ex.printStackTrace();
}
catch (SQLException ex) {
System.out.println("Problema com o SQL");
ex.printStackTrace();
}
What do you want to ask?
– PauloHDSousa
I have an error on the line "Statement stmt = Conn.createStatement();" and "stmt.executeUpdate(sqlinsert);" @Paulohdsousa
– Raphael Santos
@Raphaelsantos Edit your question and add this information. Also add what error you get.
– André Ribeiro