⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 teachlession_update2.jsp

📁 JavaWeb标签应用开发(随书光盘)为方便读者阅读本书和调试程序
💻 JSP
字号:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<html>
  <body bgcolor="#DCDADA">
  <!-------作更新操作的SQL语句-------->
  <c:set var="updateSQL"
  	value="update teachlession set lession_id=?,teacher_id=? where teachlession_id=?"/>
  <!------设置数据源------>
  <sql:setDataSource dataSource="jdbc/sqlserver" var="sqlDS"/>
  <!------作数据库操作------>
  <c:if test="${(not empty param.lession_id) and (not empty param.teacher_id)}">
  	<c:set var="selectSQL" 
  		value="select * from teachlession where lession_id=? and teacher_id=?"/>
  	<sql:query sql="${selectSQL}" 
  		var="teachlessionRS" dataSource="${sqlDS}">
  		<sql:param value="${param.lession_id}"/>
  		<sql:param value="${param.teacher_id}"/>
  	</sql:query>
  	<c:if test="${teachlessionRS.rowCount<1}">
  		<sql:update sql="${updateSQL}" 
  			var="infecCount" dataSource="${sqlDS}">
  			<sql:param value="${param.lession_id}"/>
  			<sql:param value="${param.teacher_id}"/>
  			<sql:param value="${param.teachlession_id}"/>
  		</sql:update>
  		<c:if test="${infecCount==1}">
  			更新教师授课信息成功!
  		</c:if>
  		<c:if test="${infecCount!=1}">
  			更新教师授课信息失败!
  		</c:if>
  	</c:if>
  	<c:if test="${teachlessionRS.rowCount>=1}">
  		此教师授课信息已存在!
  	</c:if>
  </c:if>
    <br><a href="teachlessionman.jsp">返回</a>
  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -