tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: Null
Date Thu, 21 Jun 2007 11:24:37 GMT
The syntax below is correct. There must be something else syntactically 
incorrect in your jsp causing your woes.

-Tim

Mohammed Zabin wrote:
> I tried it the other way, if( rs.getString("field") == null ) but the
> compiler plames that null can't be compared to string....
> 
> On 6/21/07, Tim Funk <funkman@joedog.org> wrote:
>>
>>
>> if (null == rs.getString("col_foo")) {
>>    out.println("<td>&nbsp;</td>");
>> } else {
>>    // Evil since this doesn't escape the xml - for edutainment only
>>    out.println("<td>" + rs.getString("col_foo") + "</td>");
>> }
>>
>> -Tim
>>
>> Mohammed Zabin wrote:
>> > Hi All
>> >
>> > Anyone knows how to deal with null values in JDBC ResultSet??
>> >
>> > I am trying to render a table in jsp page that read its value from the
>> > database, sometimes, the database returns null values, and so, the 
>> whole
>> > table couldn't be rendered. Is there any way to deal with null values.
>> >

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message