estava tentando fazer o inserir no banco de dados porem deu esse erro
o erro
GRAVE: null
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:61)
at com.mysql.cj.jdbc.ClientPreparedStatement.checkBounds(ClientPreparedStatement.java:1419)
at com.mysql.cj.jdbc.ClientPreparedStatement.getCoreParameterIndex(ClientPreparedStatement.java:1432)
at com.mysql.cj.jdbc.ClientPreparedStatement.setInt(ClientPreparedStatement.java:1604)
at DAO.PessoaDao.add(PessoaDao.java:36)
at gripesuinaaps.teste.main(teste.java:37)
classe de conexão
package DAO;
import JDBC.ConnectionFactory;
import Model.Pessoa;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
-
@author Guilherme
*/
public class PessoaDao {private final Connection con;
public PessoaDao(){
this.con = new ConnectionFactory().getConnection();}
public boolean add(Pessoa p){
String sql = " INSERT INTO pessoa(cpf,nome,nascimento,sexo,peso,altura,cidade,descricao,email,senha)VALUES (’?’,’?’,’?’,’?’,’?’,’?’,’?’,’?’,’?’);";try { PreparedStatement stmt = con.prepareStatement(sql); stmt.setInt(1, p.getCpf()); stmt.setString(2, p.getNome()); stmt.setString(3, p.getNascimento()); stmt.setString(4, p.getSexo()); stmt.setDouble(5, p.getPeso()); stmt.setDouble(6, p.getAltura()); stmt.setString(7, p.getCidade()); stmt.setString(8, p.getDescricao()); stmt.setString(9, p.getEmail()); stmt.setString(10, p.getSenha()); stmt.execute(); return true; } catch (SQLException ex) { Logger.getLogger(PessoaDao.class.getName()).log(Level.SEVERE, null, ex); } return false;}
}