Im having a problem with updating data in SQLite
this is the full code who execute after pressing the button
try {
PrintWriter writer = new PrintWriter("d:\\"+LBL1.getText()+"\\"+TL3.getText()+"_"+TL2.getText()+"_"+TL4.getText()+"_"+TL5.getText()+"_"+TL1.getText()+".txt", "UTF-8");
writer.println("Invoice Number = "+TL1.getText());
writer.println("Seda = " +TL3.getText());
writer.println("Date = " +TL2.getText());
writer.println("Documental Class = " + TL4.getText());
writer.println("Status = " + TL5.getText());
writer.println("Subject Name = "+tf1.getText());
writer.println("Service = " + tf2.getText());
writer.println("Price = " +TA3.getText());
writer.println("VAT Number = "+TA2.getText());
writer.println("Total price = " +TA1.getText());
writer.close();
String te1 = tf1.getText();
String te2 = TA3.getText();
String te3 = TA2.getText();
String te4 = TA1.getText();
String te5 = tf2.getText();
String te6 = TL1.getText();
String sql = "UPDATE DataImput SET SubjectName='"+te1+"' ,VATnumber='"+te3+"' ,Service='"+te5+"' ,Price='"+te2+"' ,Totalamount='"+te4+"' WHERE Invoicenumber='"+te6+"'";
pst=conn.prepareStatement(sql);
rs= pst.executeQuery();
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}finally{
try{
rs.close();
pst.close();
}
catch(Exception e){
}
}
it work to create the file. but it does not execute querry to update the data. where is the mistake?