
how to create multiple tables in oracle 9i using jsp program.

JSP create multiple tables in database
We have used Mysql database
1)tables.jsp:
<html>
<script>
function NoOfTables(no){
document.getElementById("count").value=no;
var i = 1;
for(i=1;i<=no;i++){
my_div.innerHTML = my_div.innerHTML +"<br><label>Table "+i+"</label><input type='text' name='mytext'>";
}
}
</script>
No of tables to be created into database:<input type="text" id="no" onkeyup="NoOfTables(this.value);">
<form name ="f" method="post" action="createtables.jsp">
<div id="my_div"></div>
<input type="hidden" id="count" name="count">
<input type="submit" value="Create">
</form>
2)createtables.jsp:
<%@page import="java.sql.*"%>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
Statement stmt=con.createStatement();
String values[]=request.getParameterValues("mytext");
for(int i=0;i<values.length;i++){
System.out.println(values[i]);
String table = "CREATE TABLE "+values[i]+"(id integer)";
stmt.executeUpdate(table);
}
%>