Boa tarde, estou estudando java e me deparei com o seguinte erro
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: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 'in to tbusuarios(iduser, usuario, fone, login, senha, perfil) values (‘4’,‘Adalb’ at line 1
o meu código é muito simples, segue as partes que se referenciam ao Update
private void adicionar (){
String sql = "insert in to tbusuarios(iduser, usuario, fone, login, senha, perfil) values (?,?,?,?,?,?)";
try {
pst=conexao.prepareStatement(sql);
pst.setString(1,txtUsuId.getText());
pst.setString(2,txtUsuNome.getText());
pst.setString(3,txtUsuFone.getText());
pst.setString(4,txtUsuLogin.getText());
pst.setString(5,txtUsuSenha.getText());
pst.setString(6,cboUsuPerfil.getSelectedItem().toString());
pst.executeUpdate();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}
}
private void btnUsuCreateActionPerformed(java.awt.event.ActionEvent evt) {
// chama o método adicionar
adicionar();