<%
   String connStr=request.getParameter("connStr");
   if (connStr==null) {
     connStr=(String)session.getValue("connStr");
   } else {
     session.putValue("connStr",connStr);
   }
   if (connStr==null) { %>
<jsp:forward page="../setconn.jsp" />
<%
   }
%>
<%@ taglib uri="/WEB-INF/sqltaglib.tld" prefix="jml" %>
<HTML>
<HEAD> <TITLE> Nested Tag with Query inside Open  </TITLE> </HEAD>
<BODY BGCOLOR=white>

<% String searchCondition = request.getParameter("cond");
   if (searchCondition != null) { %>
      <H3> Search results for : <I> <%= searchCondition %> </I> </H3>
      <HR><BR>
<% } else searchCondition = ""; %>

<B>Enter a search condition:</B>
<FORM METHOD=get>
<INPUT TYPE="text" NAME="cond" SIZE=30>
<INPUT TYPE="submit" VALUE="Ask Oracle");
</FORM>

<HR>
<jml:dbOpen URL="<%= connStr %>"  user="scott" password="tiger">
    <jml:dbQuery>
       SELECT ename, sal FROM scott.emp 
       <%= (searchCondition.equals("") ? "" : "WHERE " + searchCondition ) %> 
    </jml:dbQuery>
    </jml:dbOpen>
</HR> 
</BODY> 
</HTML> 

