## error ## java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near "-": syntax error)`
btnSave = new JButton("SAVE");
btnSave.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try{
String query=" insert into Accounts(id,name,f_name,Address,P-address)values(?,?,?,?,?) ";
PreparedStatement pst=connect.prepareStatement(query);
pst.setString(1,txtid.getText());
pst.setString(2,txtename.getText());
pst.setString(3,txtfname.getText());
pst.setString(4,txtaddress.getText());
pst.setString(5,txtpaddress.getText());
pst.execute();
JOptionPane.showMessageDialog(null, "Data saved");
} catch (Exception e) {
e.printStackTrace();
}
dimanche 6 mars 2016
i am trying to make small database with java+sqlite which accept input from user and save recored here is my code giving error
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire