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

📄 _test__jsp.java

📁 通子的考试系统 本程序版权属于通子 程序功能: 1。考生可以选择科目进行考试 2. 考过科目不再重新登陆考试 2。考题时随机的
💻 JAVA
字号:
/*
 * JSP generated by Resin-3.0.8 (built Tue, 08 Jun 2004 02:25:40 PDT)
 */

package _jsp;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.Date;
import java.util.Random;

public class _test__jsp extends com.caucho.jsp.JavaPage{
  private boolean _caucho_isDead;

  

  Connection con = null;

  Statement stmt = null;

  ResultSet rs = null;

  ResultSet rsScore=null;

  public void jspInit()

  {

  	try

  	{

  		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

  		//\u8f7d\u5165\u9a71\u52a8\u7a0b\u5f0f\u7c7b\u522b

  

  		con = DriverManager.getConnection("jdbc:odbc:test");

  		//\u5efa\u7acb\u6570\u636e\u5e93\u8fde\u7ebf

  

  		stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,

  					     ResultSet.CONCUR_READ_ONLY);

  		//\u5efa\u7acbStatement\u53d8\u91cf, \u5e76\u8bbe\u5b9a\u8bb0\u5f55\u6307\u6807\u7c7b\u578b\u4e3a\u53ef\u524d\u5f8c\u79fb\u52a8

  	}

  	catch(Exception ex)

  	{

  		System.out.println(ex.toString());

  	}

  }

  public void jspDestroy()

  {

  	try

  	{

  		stmt.close(); //\u5173\u95edStatement\u53d8\u91cf

  		con.close();  //\u5173\u95edConnection\u53d8\u91cf

  		rs.close(); //\u5173\u95edResultSet\u53d8\u91cf

  		rsScore.close();

  	}

  	catch(Exception ex)

  	{

  		System.out.println(ex.toString());

  	}

  }


  
  public void
  _jspService(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
    throws java.io.IOException, javax.servlet.ServletException
  {
    javax.servlet.http.HttpSession session = request.getSession(true);
    com.caucho.server.webapp.Application _jsp_application = _caucho_getApplication();
    javax.servlet.ServletContext application = _jsp_application;
    com.caucho.jsp.PageContextImpl pageContext = com.caucho.jsp.QJspFactory.allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true);
    javax.servlet.jsp.JspWriter out = pageContext.getOut();
    javax.servlet.ServletConfig config = getServletConfig();
    javax.servlet.Servlet page = this;
    response.setContentType("text/html;charset=GB2312");
    request.setCharacterEncoding("GB2312");
    try {
      out.write(_jsp_string0, 0, _jsp_string0.length);
      
	 String Lesson = (String)session.getAttribute("Lesson");
	String No=(String)session.getAttribute("No");
	String Name=(String)session.getAttribute("Name");		
	String SQL = "Select * From " + Lesson + " Order By \u9898\u53f7";   	
	rs=stmt.executeQuery(SQL);		

      out.write(_jsp_string1, 0, _jsp_string1.length);
      out.print((Lesson));
      out.write(_jsp_string2, 0, _jsp_string2.length);
      out.print((new Date().getTime() ));
      out.write(_jsp_string3, 0, _jsp_string3.length);
      
String TestType = "";
boolean bn[]=new boolean[9];//\u8bbe\u7f6eboolean\u6570\u7ec4
int i=1;
Random  random=new Random();
String strQNum="";
while(i<6){
	 int chum=random.nextInt(8)+1;
	 if(bn[chum-1]!=true){
	 bn[chum-1]=true; 
	 rs.absolute(chum);//\u8bbe\u7f6e\u6307\u9488\u7684\u4f4d\u7f6e 

	String leixing = rs.getString("\u7c7b\u578b");	
	String tihao = rs.getString("\u9898\u53f7");
	String Ans = rs.getString("\u89e3\u7b54");	
	session.setAttribute("tihao"+i,tihao);
	session.setAttribute("Ans"+i,Ans);	
	session.setAttribute("leixing",leixing);
	out.print( i+"&nbsp;"+rs.getString("\u9898\u76ee") +
	leixing + ":" + rs.getString("\u5206\u6570") + "\u5206)</B>");
	out.print("<div>");
	int j=1;
//while(j<5)
 //{ 
       TestType=leixing.equals("\u5355\u9009")?"Radio": "CheckBox";				
out.print("A<INPUT Type='"+TestType+ "'Name=No" + tihao +
			" Value='1'>" +rs.getString("\u9009\u98791")+ "<BR>");
out.print("B<INPUT Type='"+TestType+ "'Name=No" + tihao +
			" Value='2'>" +rs.getString("\u9009\u98792")+ "<BR>");
out.print("C<INPUT Type='"+TestType+ "'Name=No" + tihao +
			" Value='3'>" +rs.getString("\u9009\u98793")+ "<BR>");
out.print("D<INPUT Type='"+TestType+ "'Name=No" + tihao +
			" Value='4'>" +rs.getString("\u9009\u98794")+ "<BR>");					
			//j=j+1;
	//}	
	out.print("</div>");
	i=i+1;
}
} 

      out.write(_jsp_string4, 0, _jsp_string4.length);
      out.print((strQNum));
      out.write(_jsp_string5, 0, _jsp_string5.length);
    } catch (java.lang.Throwable _jsp_e) {
      pageContext.handlePageException(_jsp_e);
    } finally {
      com.caucho.jsp.QJspFactory.freePageContext(pageContext);
    }
  }

  private com.caucho.java.LineMap _caucho_line_map;
  private java.util.ArrayList _caucho_depends = new java.util.ArrayList();

  public java.util.ArrayList _caucho_getDependList()
  {
    return _caucho_depends;
  }

  public void _caucho_addDepend(com.caucho.make.PersistentDependency depend)
  {
    super._caucho_addDepend(depend);
    _caucho_depends.add(depend);
  }

  public boolean _caucho_isModified()
  {
    if (_caucho_isDead)
      return true;
    if (com.caucho.util.CauchoSystem.getVersionId() != 1174304630)
      return true;
    for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
      com.caucho.make.Dependency depend;
      depend = (com.caucho.make.Dependency) _caucho_depends.get(i);
      if (depend.isModified())
        return true;
    }
    return false;
  }

  public long _caucho_lastModified()
  {
    return 0;
  }

  public com.caucho.java.LineMap _caucho_getLineMap()
  {
    return _caucho_line_map;
  }

  public void destroy()
  {
      _caucho_isDead = true;
      super.destroy();
  }

  public void init(com.caucho.java.LineMap lineMap,
                   com.caucho.vfs.Path appDir)
    throws javax.servlet.ServletException
  {
    com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
    com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
    mergePath.addMergePath(appDir);
    mergePath.addMergePath(resinHome);
    com.caucho.loader.DynamicClassLoader loader;
    loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
    String resourcePath = loader.getResourcePathSpecificFirst();
    mergePath.addClassPath(resourcePath);
    _caucho_line_map = new com.caucho.java.LineMap("_test__jsp.java", "foo");
    _caucho_line_map.add("/Conn.jsp", 2, 16);
    _caucho_line_map.add("/test.jsp", 4, 72);
    _caucho_line_map.add(24, 80);
    _caucho_line_map.add(26, 82);
    _caucho_line_map.add(29, 84);
    _caucho_line_map.add(69, 125);
    com.caucho.vfs.Depend depend;
    depend = new com.caucho.vfs.Depend(appDir.lookup("test.jsp"), "AlMtiRYZL1SL7q55nHKp7w==", false);
    _caucho_depends.add(depend);
    depend = new com.caucho.vfs.Depend(appDir.lookup("Conn.jsp"), "RfAIAIG26G1VcP1cIkfxrA==", false);
    _caucho_depends.add(depend);
  }

  private final static char []_jsp_string2;
  private final static char []_jsp_string1;
  private final static char []_jsp_string0;
  private final static char []_jsp_string3;
  private final static char []_jsp_string5;
  private final static char []_jsp_string4;
  static {
    _jsp_string2 = "<HR></H2>\r\n	<FORM Action=\"score.jsp\" Method=\"GET\"   name=\"form1\">	\r\n  <input type=\"hidden\" name=\"Time\" value=\"".toCharArray();
    _jsp_string1 = "\r\n <HTML>\r\n   <head>\r\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<!-- \u4f7f\u7528javascript \u8bbe\u5b9a30\u79d2\u81ea\u52a8\u63d0\u4ea4-->\r\n<script language=\"javascript\">\r\nsetInterval(\"document.all.form1.submit()\",3000*10);\r\n</script>\r\n<title>\u5728\u7ebf\u8003\u8bd5\u7cfb\u7edf</title>\r\n</head>\r\n	<BODY  BGCOLOR=#CCCCCC>\r\n	<CENTER>\r\n	<H1><FONT COLOR=#6699DD>\u5728\u7ebf\u8003\u8bd5\u7cfb\u7edf</FONT></H1>	 \r\n	</CENTER>\r\n	<H2>\u8003\u8bd5\u79d1\u76ee -- ".toCharArray();
    _jsp_string0 = "\r\n\r\n\r\n\r\n".toCharArray();
    _jsp_string3 = "\">\r\n \r\n \r\n".toCharArray();
    _jsp_string5 = "\">\r\n<INPUT Type=Submit Value=\"  \u4ea4 \u5377  \">\r\n</FORM>\r\n    <hr>    \r\n </BODY>\r\n</HTML>\r\n".toCharArray();
    _jsp_string4 = "\r\n<input type=\"hidden\" name=\"hidQNum\" value=\"".toCharArray();
  }
}

⌨️ 快捷键说明

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