Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JSTL SQL tag related ..issue

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do the following but its giving me error saying that sql doesnt have any query to execute. I print out the sqlQuery sting and it prints it out properly but sql="${sqlQuery}" portion of the code doesnt work. Can anyone please tell me why?
<%
String sqlQuery = sqlQueryBean.getQuery();
%>
<h2><%=sqlQuery%>
<sql:setDataSource dataSource="jdbc/_Obweo" />
<sql:query var="selectedRows"
sql="${sqlQuery}">

</sql:query>
<Select name="SysUserID">
<c:forEach var="currentRow" items="${selectedRows.rows}">
<option <c: out value="${currentRow.SystemuserID}" />>
<c: out value="${currentRow.first}" /> <c: out value="${currentRow.last}" />
</option>
</c:forEach>
</select>


Thanks in Advance
 
Rajibul Alam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.servlet.ServletException: javax.servlet.jsp.JspTagException: No SQL statement specified

root cause

javax.servlet.jsp.JspTagException: No SQL statement specified

is the Error that I get
 
Rajibul Alam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Figured out the solution....maybe it will help someone else someday

<c:set var="qry" value="${Query}" />

<sql:setDataSource dataSource="jdbc/_Obweo" />
<sql:query var="selectedRows" scope="application"
sql="${qry}">

</sql:query>
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic