📄 studentwsxk2_0002ejsp_jsp.java
字号:
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class studentwsxk2_0002ejsp_jsp extends HttpJspBase {
// begin [file="/studentwsxk2.jsp";from=(2,0);to=(2,55)]
// end
static {
}
public studentwsxk2_0002ejsp_jsp( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
String _value = null;
try {
if (_jspx_inited == false) {
synchronized (this) {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
}
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html;charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/studentwsxk2.jsp";from=(0,69);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/studentwsxk2.jsp";from=(1,44);to=(2,0)]
out.write("\r\n");
// end
// begin [file="/studentwsxk2.jsp";from=(2,0);to=(2,55)]
wsxk.ConDB sts = null;
boolean _jspx_specialsts = false;
synchronized (pageContext) {
sts= (wsxk.ConDB)
pageContext.getAttribute("sts",PageContext.PAGE_SCOPE);
if ( sts == null ) {
_jspx_specialsts = true;
try {
sts = (wsxk.ConDB) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "wsxk.ConDB");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"wsxk.ConDB", exc);
}
pageContext.setAttribute("sts", sts, PageContext.PAGE_SCOPE);
}
}
if(_jspx_specialsts == true) {
// end
// begin [file="/studentwsxk2.jsp";from=(2,0);to=(2,55)]
}
// end
// HTML // begin [file="/studentwsxk2.jsp";from=(2,55);to=(4,0)]
out.write("\r\n\r\n");
// end
// begin [file="/studentwsxk2.jsp";from=(4,2);to=(26,0)]
String strSQL1 = "select scid from sc order by scid asc";
ResultSet rs2 = sts.executeQuery(strSQL1);
String MaxID = new String();
int id1 = 0;
while(rs2.next())
{
id1 = rs2.getInt("scid");
}
/*int k = 0;
for (k = 0; k < 999999; k++)
{
if (id.equals(MaxID.valueOf(k)))
break;
}
++k;
if (k >= 999999)
k = 1;
id = MaxID.valueOf(k);*/
id1++;
System.out.println("id1" + id1);
rs2.close();
// end
// HTML // begin [file="/studentwsxk2.jsp";from=(26,2);to=(28,0)]
out.write("\r\n\r\n");
// end
// begin [file="/studentwsxk2.jsp";from=(28,2);to=(44,0)]
String couid = new String();
String teaid = new String();
String tcid = new String (request.getParameter("xuan"));
System.out.println (tcid);
int id = Integer.parseInt(tcid);
System.out.println (id);
String sql = "select tcid,teaid,couid from tc where tcid = "+id+"";
ResultSet rs = sts.executeQuery(sql);
while(rs.next())
{
couid = rs.getString("couid");
teaid = rs.getString("teaid");
}
// end
// HTML // begin [file="/studentwsxk2.jsp";from=(44,2);to=(45,0)]
out.write("\r\n");
// end
// begin [file="/studentwsxk2.jsp";from=(45,2);to=(48,0)]
String sql2 = "insert into sc(scid,teaid,couid,stuid) values("+id1+",'"+teaid+"','"+couid+"','"+session.getValue("wnum")+"')";
sts.executeUpdate(sql2);
// end
// HTML // begin [file="/studentwsxk2.jsp";from=(48,2);to=(74,7)]
out.write("\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<meta HTTP-EQUIV=REFRESH CONTENT=\"5; URL=studentwsxk.jsp\">\r\n<link href=\"_notes/aaa.css\" rel=\"stylesheet\" type=\"text/css\">\r\n<style type=\"text/css\">\r\n<!--\r\n@import url(\"_notes/ccc\");\r\nbody,td,th {\r\n\tfont-size: 12px;\r\n\tcolor: #FFFFFF;\r\n\tfont-weight: bold;\r\n}\r\n.style1 {color: #000000}\r\n-->\r\n</style>\r\n</HEAD>\r\n<BODY BGCOLOR=#0D85A6 BACKGROUND=\"images/bg.gif\" >\r\n<div align=\"center\">\r\n <p align=\"center\"> <br>\r\n 您已经成功选取该课程,本页将于5秒内自动<a href=\"studentwsxk.jsp\" class=\"style1\">返回前页</a> </p>\r\n <p><br>\r\n <img src=\"images/index_globe.jpg\" width=\"760\" height=\"186\"></p>\r\n</div>\r\n</BODY>\r\n</HTML>");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -