It does not replace the null values

1

Good ... my problem is that when saving in the database is saved as null that is why when I call it I give a condition that if it is null I paint it empty but it does not work ... I saw another way of doing it but it did not work for me either Any advice?

<%
String ayuno= '';
COMANDO="SELECT AYUNO FROM PRUEBA.RECETA WHERE ID='22'" ;
  rset = stmt.executeQuery(COMANDO);
      if(rset.next()){
ayuno=rset.getString("ayuno");if(ayuno==null)ayuno="";
      }
%>
<tr>
<td><label for="conf_nom_proc">Ayuno</label></td>
<td colspan="3"><input  type="text"  id="ayuno" name="ayuno" size="20" value="<%=ayuno%>" ></td>
</tr>
    
asked by Julio Cesar 08.09.2017 в 18:26
source

1 answer

0

Try this way:

ayuno=rset.getString("ayuno");if(ayuno==null || ayuno.toUpperCase().equals("NULL"))ayuno="";
    
answered by 08.09.2017 / 18:42
source