<%! String dataSrcStr; %>
<%@ include file="checkDataSource.jsp" %>

<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/sqltaglib.tld" prefix="sql" %>
<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>
            <sql:dbOpen dataSource="<%= dataSrcStr %>"  >
              <% if (request.getParameter("drop")!=null) { %>
              <sql:dbExecute output="yes">
                 drop table test_table
              </sql:dbExecute>
              <% } %>
              <% if (request.getParameter("create")!=null) { %>
              <sql:dbExecute output="yes">
                 create table test_table (col1 NUMBER)
              </sql:dbExecute>
              <% } %>
              <% if (request.getParameter("insert")!=null) { %>
              <sql:dbExecute output="yes">
                insert into test_table values (1234)
              </sql:dbExecute>
              <% } %>
              <% if (request.getParameter("select")!=null) { %>
              <sql:dbQuery>
                 select * from test_table order by col1
              </sql:dbQuery>
              <% } %>
            </sql:dbOpen>
            <HR> 
</BODY> 
</HTML> 

