• Post Reply Bookmark Topic Watch Topic
  • New Topic

DBTag print/renders sql query statement  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am attempting to use DBTag and have run into an issue when no records exist for a query request.
When no records are returned for the resultset does anyone know why the SQL query statement will be printed / how to suppress this?? It is an intermittent problem that seems to occur when all the records are deleted and the page is refreshed.
As an example from the code snippet below - When the problem occurs I will see "select ContactFN, ContactLN, from Contacts where SubscriberNumber = 1 order by ContactLN" printed above my table column header.

code snippet:
<sql:connection id="conn1">
<sql river><%=strDatabaseJDBCDriver%></sql river>
<sql assword><%=strDatabasePassword%></sql assword>
<sql reparedStatement id="stmt1" conn="conn1">
select ContactFN,
from Contacts
where SubscriberNumber = <%=strCustomerID%> order by ContactLN
<TD WIDTH="150" HEIGHT="25" CLASS="categories" BACKGROUND="_images/black2_bg.gif">First Name </TD>
<TD WIDTH="150" HEIGHT="25" CLASS="categories" BACKGROUND="_images/black2_bg.gif">Last Name</TD>
<%-- loop through the rows/query --%>
<sql:resultSet id="rset2">

<TR ALIGN="CENTER" CLASS="copy2" BGCOLOR=\"#CCCCCC\" RECNUM=<sql:getColumn position="6"/> >
<td <%=strTableStyle%> >
<sql:getColumn position="1"/>
<td <%=strTableStyle%> >
<sql:getColumn position="2"/>

<td colspan="2">
No records found

</sql reparedStatement >
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!