error when inserting a double value in a database

0

I try to make an insert of a double value into a database (MySQL) and it shows me the error: java.sql.SQLException: '∞' is not valid numeric or approximate numeric value

Connection conexion = AdminConexion.getInstancia().obtenerConexion();
        PreparedStatement pstm = conexion.prepareStatement("insert into Lista( NombreLista, Agasajado, Monto a Recaudar por Participante, Monto Recaudado, Monto a Recaudar, Fecha Inicio, Fecha Fin, Mail Agasajado, Administrador, FechaAgasajo ) values (?,?,?,?,?,?,?,?,?,?)");
        pstm.setString(1, lista.getNombreLista());
        pstm.setString(2, lista.getAgasajado());
        pstm.setDouble(3, lista.getMontoARecaudarPorParticipante());
        pstm.setDouble(4, lista.getMontoRecaudado());
        pstm.setDouble(5, lista.getMontoARecaudar());
        pstm.setString(6, lista.getFechaInicio());
        pstm.setString(7, lista.getFechaFin());
        pstm.setDouble(8, lista.getMontoRecaudado());
        pstm.setInt(9, lista.getAdministrador().getCodigo());
        pstm.setString(10, lista.getFechaAgasajo());
        pstm.execute();

    
asked by Eze Cufre 17.06.2018 в 03:34
source

1 answer

0

The field declaration does not match the value assignment.

you assign pstm.setDouble (8, list.getMontoRecaudado ()); where it was expected, Mail Hosted that very possibly should be string.

I do not see clearly why the error points to '∞' is not a valid numeric or approximate numeric value unless it triggers because it does not wait for setDouble with param 8. If that is not the problem at least you will solve the assignment that is observed in the code. I hope it serves.

    
answered by 17.06.2018 в 04:55