Não sei qual é esse parametro 1 que ele tanto fala?
public void seekPeriodSales(Date inicialDate, Date finaldate){
String sql = "select * from sales where data_changed between ? and ?";
try {
PreparedStatement statement = connection.prepareStatement(sql);
ResultSet rs = statement.executeQuery();
while(rs.next()) {
statement.setDate(1, inicialDate);
statement.setDate(2, finaldate);
Integer saleId = rs.getInt("id");
Double saleValor = rs.getDouble("value_sale");
Date date = rs.getDate("data_changed");
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
JOptionPane.showMessageDialog(null, "SALE ID: " + saleId +
" VALUE: " + saleValor + " DATE: " + format.format(date));
}
} catch (SQLException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "cannot share");
}
}


