SQL result returns nothing, but empty == false?
Hello,
Been trying to work with JSTL resultsets and for some reason, the variables evlauate to not empty, but the resulset returns no records.
Not idea why...
<sql:setDataSource
driver="com.microsoft.jdbc.sqlserver.SQLServerDriv er"
url="jdbc:microsoft:sqlserver://orion:1433"
user="web"
password="web"
var="dataSource" />
<sql:query var="banner" dataSource="${dataSource}">
SELECT TOP 1 [PublishDate],[FileName]
FROM [dbo].[1071_f_IntranetDocs]
WHERE (getDate() >= PublishDate) AND (getDate() <= ExpDate) AND WebFolder = 'VC'
ORDER BY PublishDate desc
</sql:query>
<c:out value="${banner == null}"/>
<c:out value="${empty banner}"/>
Both of these c:out return false, meaning, the resultset is not empty and not == null, but I'm 100% that the query doesn't return any records.
So what am I to do to detect if no records wre returned?
|