vendredi 19 juin 2015

If else java set sql column value

I hope someone can help me, I am a novice at Java and I need to understand how I can populate a SQL returned column with the result from the if statement below.

If the result is true I need the EUR to display the value from the CN* else just return the amount field.

   if(returnt.getString("ins_type",i).contains("A DRAWDOWN")
        || returnt.getString("ins_type",i).contains("B DRAWDOWN"))
       returnt.setDouble("eur", i, -1 * Str.strToDouble(returnt.getString("CN*", i)));
    else
       returnt.setDouble("eur", i, returnt.getDouble("amount", i));

Thanks, RM

Aucun commentaire:

Enregistrer un commentaire