indexShow.jsp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <%@ page contentType="text/html; charset=UTF-8" language="java"%>
  2. <%@ page import ="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  3. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  4. com.sysmodel.datamodel.xmlmodel.impl.MdpDataSourceImpl,
  5. com.sysmodel.datamodel.xmlmodel.able.MdpDataSource,
  6. com.persistence.DBdll.adapter.DatabaseAdapter,
  7. com.persistence.DBdll.DatabaseFactory,
  8. com.persistence.DBdll.adapter.assitant.index.IndexInfo,
  9. java.util.ArrayList"
  10. %>
  11. <HTML>
  12. <HEAD>
  13. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  14. <TITLE></TITLE>
  15. <style type="text/css">
  16. <!--
  17. .STYLE1 {
  18. font-size: 24px;
  19. font-weight: bold;
  20. }
  21. .STYLE2 {color: #FF0000}
  22. -->
  23. </style>
  24. </HEAD>
  25. <%
  26. SysModel sysmodel = ModelFactory.getSysmodel();
  27. MdpDataSource datasource = sysmodel.getDataSourceByCode(1);
  28. DatabaseAdapter Dbadapter = DatabaseFactory.getInstance(datasource);
  29. ArrayList<IndexInfo> indlis = Dbadapter.getTableIndexInfo();
  30. String title = sysmodel.getUnitname()+"("+sysmodel.getUnitCode()+")数据库字段索引创建情况一览";
  31. %>
  32. <body>
  33. <center>
  34. <h2>
  35. <span class="STYLE2"><%=title %></span>
  36. <input type="button" onClick="javascript:outPdaExcel();" value="导出EXCEL">
  37. </h2>
  38. </center>
  39. <div id="PrintDiv">
  40. <table id='tabid' width="95%" border="1" align="center" cellspacing="0" bordercolor="#0000FF">
  41. <tr>
  42. <td colspan="11" align="left"><%=title %></td>
  43. </tr>
  44. <tr>
  45. <td>序号</td>
  46. <td>表名</td>
  47. <td>索引名称</td>
  48. <td>类型</td>
  49. <td>字段</td>
  50. </tr>
  51. <%for(int i = 0; i < indlis.size(); i ++){
  52. IndexInfo IndexInfo = indlis.get(i);
  53. %>
  54. <tr>
  55. <td><%=i+1%></td>
  56. <td><%=IndexInfo.getTabName()%></td>
  57. <td><%=IndexInfo.getIndexName()%></td>
  58. <td><%=IndexInfo.getIndexType()%></td>
  59. <td><%=IndexInfo.getColumNames()%></td>
  60. </tr>
  61. <%
  62. }
  63. %>
  64. </table>
  65. </div>
  66. <form name="ExcleformOut" method="post" action="" target="_top">
  67. <input type="hidden" name="t1">
  68. </form>
  69. <script type="text/javascript">
  70. //导出Excel
  71. function outPdaExcel(){
  72. var oTable=document.getElementById("tabid");
  73. //如果 border=0 想在打印的表格中出现边框 需要设置
  74. //oTable.border=1;
  75. ExcleformOut.t1.value=PrintDiv.innerHTML;
  76. ExcleformOut.action='printExcel.jsp';
  77. ExcleformOut.submit();
  78. //原来 border=0 想在打印的表格中出现边框 打印完后设置回去
  79. //oTable.border=0;
  80. }
  81. </script>
  82. </BODY>
  83. </HTML>