1
The console presents me the following error:
FUNCTION worksoviagemd.SUM does not exist. Check the 'Function Name Parsing and Resolution' Section in the Reference Manual
Can only be sql in my prepareStatement, help me!
Dao method
public List<ViagemBean> getListaTotalDiaria(String totalDiaira) {
try {
List<ViagemBean> viagens = new ArrayList<ViagemBean>();
ConexaoMySQL.conectar();
PreparedStatement stmt = ConexaoMySQL.getConexao()
.prepareStatement("select SUM (valorDiaria) as total from viagem where colaborador = ? ");
stmt.setString(1, totalDiaira);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
// criando o objeto viagem
ViagemBean viagem = new ViagemBean();
viagem.setValorDiaria(rs.getDouble("total"));
// adicionando o objeto à lista
viagens.add(viagem);
}
rs.close();
stmt.close();
return viagens;
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
Thanks guy was that right ;)
– Marcelo T. Cortes