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

📄 showquest.jsp

📁 关于java考试的一些复习资料
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@ page import="java.sql.*"  %>
<%@ page import="jinghua.*"%>


<jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
</jsp:useBean>

<%!String strQuest1,strTip,strQuest2=null;%>
<%!Connection Conn;%>
<%
String DBID="";
int dbid=-1;

if(!(session.isNew())){
	DBID=request.getParameter("dbid");
	if(DBID==null){
		DBID="";
	}
	DBID=jinghua.Tools.codestring(DBID);
}

if(!(DBID.equals("")))
{

	dbid=Integer.parseInt(DBID);
	Connection Conn=DBCon.getConnection();
	Statement stmt = Conn.createStatement();
	ResultSet rs;
	String strHtml=null;
	String sql;

	try{
		strQuest1=null;

  		sql="select ID,QuestText,Tip from question where id="+dbid;
  		rs=stmt.executeQuery(sql);
  		if(rs.next()){
    	strQuest1=rs.getString("QuestText");
		strTip=rs.getString("Tip");

  		}
  	}catch (SQLException e) {
  	System.out.println(e);
  	e.printStackTrace();
	}
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>



<table width="84%" border="1" align="center">
  <tr>
    <td colspan="3" align="center">Question数据库查询</td>
  </tr>
  <tr align="left">
    <td width="24%" rowspan="2"><form name="form1" method="post" action="ShowQuest.jsp">
        <table width="64%" height="78" border="0">
          <tr>
            <td><input name="dbid" type="text" id="dbid" size="10"></td>
          </tr>
          <tr>
            <td><input type="submit" name="Submit" value="提交"></td>
          </tr>
        </table>
        <font size="-1"><font size="-3"></font></font> </form></td>
    <td height="208" colspan="2"> <%if(strQuest1==null) out.print("<BR>"); else	out.print(strQuest1);%> &nbsp;</td>
    <td width="3%" rowspan="2"></td>
  </tr>
  <tr align="left">
    <% if(strQuest1!=null)
    	strQuest1=jinghua.Tools.toHtml(strQuest1);%>
    <td width="26%" height="200"><%if (strQuest1==null) out.print("<BR>");	else out.print(strQuest1);%> &nbsp;</td>
    <td width="47%" height="200"><%if (strTip==null) out.print("<BR>");	else out.print(strTip);%>&nbsp;</td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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