<%@ page import="dao.tabledao" %>
<%@ page import="java.util.List" %><%--
Created by IntelliJ IDEA.
User: 11625
Date: 2021/11/19
Time: 22:40
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<%
String colname=request.getParameter("colname");
String sql="select * from col where table_name='"+colname+"'";
String sql1 ="select * from "+colname;
tabledao tabledao=new tabledao();
List<String> a = null;
List<List<String>> datalist = tabledao.datalist(sql, sql1);
System.out.println(datalist);
%>
<table width="100" border="1">
<%
for(int i=0;i<datalist.size();i++){
a=datalist.get(i);
System.out.println(a);
%>
<tr>
<%
for(int j=0;j<a.size();j++){
if(i==0){
%>
<th align="center" valign="middle"><%=a.get(j)%></th>
<%}
else{
%>
<td align="center" valign="middle"><%=a.get(j)%></td>
<%}}
%></tr><%}%></table>
</body>
</html>