excuteSql.jsp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <%@ page contentType="text/html; charset=UTF-8" language="java"%>
  2. <%@ page import="java.util.*"%>
  3. <%@ page
  4. import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  5. com.sysmodel.datamodel.xmlmodel.impl.MdpModuleImpl,
  6. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  7. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl"%>
  8. <%@ page import = "com.persistence.service.SysPersistence"%>
  9. <%@ page import = "com.persistence.service.PersistenceFactory"%>
  10. <HTML>
  11. <HEAD>
  12. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  13. <TITLE></TITLE>
  14. <link rel="stylesheet" href="../../../styles/style.css"
  15. type="text/css"></link>
  16. <link rel="stylesheet" href="../../../styles/css.css"
  17. type="text/css"></link>
  18. </HEAD>
  19. <body class="tundra">
  20. <%
  21. String excute = request.getParameter("excute") == null ? "" : request.getParameter("excute");
  22. if(!excute.equals("")){
  23. String sql = request.getParameter("sqlstring");
  24. out.print(sql);
  25. SysModel sysmodel = ModelFactory.getSysmodel();
  26. SysPersistence persistence = PersistenceFactory.getInstance(sysmodel);
  27. int i = persistence.executeUpdateSQL(99,sql);
  28. out.print("成功执行了" + i + "条记录");
  29. }
  30. %>
  31. <form name="form1" method="post" action="excuteSql.jsp">
  32. <div id="total">
  33. <div class="whiteborder">
  34. <div class="titback">
  35. <div class="floatleft"><img src="../../../images/index/arrow1.gif" alt="1"
  36. width="20" height="24" /></div>
  37. <div class="dropshadow"> 数据库维护</div>
  38. <div class="clear"></div>
  39. </div>
  40. <div class="report">
  41. <table height="70%" align="center">
  42. <tr>
  43. <td>执行的操作</td>
  44. <td><textarea name="sqlstring" rows="20" cols="120"></textarea></td>
  45. </tr>
  46. <tr>
  47. <td colspan="2" align="center"><input type="submit" name="excute" value="执行"> &nbsp;&nbsp;&nbsp;<input type="reset" value="取消"></td>
  48. </tr>
  49. </table>
  50. </div>
  51. </div>
  52. </div>
  53. </form>
  54. </BODY>
  55. </HTML>