• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL SQL tag related ..issue

 
Rajibul Alam
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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic