<%
   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>DML Sample</TITLE></HEAD>
<FORM METHOD=get>
<INPUT TYPE="submit" name="create" VALUE="create table test_table (col1 NUMBER)"><br>
<INPUT TYPE="submit" name="drop" VALUE="drop table test_table"><br>
<INPUT TYPE="submit" name="insert" VALUE="insert into test_table values (1234)"><br>
<INPUT TYPE="submit" name="select" VALUE="select * from test_table"><br>
</FORM>
<P>Note:<B> You should first create a table before you drop it. </B>
<BODY BGCOLOR="#FFFFFF"> 
<P>Result:
            <HR>
            <jml:dbOpen URL="<%= connStr %>"  
             user="scott" password="tiger">
              <% if (request.getParameter("drop")!=null) { %>
              <jml:dbExecute output="yes">
                 drop table test_table
              </jml:dbExecute>
              <% } %>
              <% if (request.getParameter("create")!=null) { %>
              <jml:dbExecute output="yes">
                 create table test_table (col1 NUMBER)
              </jml:dbExecute>
              <% } %>
              <% if (request.getParameter("insert")!=null) { %>
              <jml:dbExecute output="yes">
                insert into test_table values (1234)
              </jml:dbExecute>
              <% } %>
              <% if (request.getParameter("select")!=null) { %>
              <jml:dbQuery>
                 select * from test_table
              </jml:dbQuery>
              <% } %>
            </jml:dbOpen>
            <HR> 
</BODY> 
</HTML> 

