📄 inqure1.jsp
字号:
<%@ page contentType="text/html;charset=gb2312" %>
<HTML>
<HEAD>
<TITLE>inqure</TITLE>
</HEAD>
<BODY>
<%@ page language="java" import="java.sql.*,javax.sql.*;" %>
查询信息窗口
[<a href="inqure.html" target=3>返回</a>]
<%
String year=request.getParameter("year");
String teacher=request.getParameter("name");
String t=new String(teacher.toString().getBytes("8859_1"));
%>
<br><br>在 <font color="#0000a0"><%=year%>年 <%=t%></font> 老师的
<%
String jdbcDriver="com.mysql.jdbc.Driver";
String jdbcURL="jdbc:mysql://localhost:3306/teacher";
try{
Class.forName(jdbcDriver);
Connection con=DriverManager.getConnection(jdbcURL,"root","000000");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from getAward where author='"+teacher+"'");
int count=0;
%><br>获奖信息:<%
while(rs.next()){
if(rs.getString("time").substring(0,4).equals(year)){
count++;
String author=new String(rs.getString("author").toString().getBytes("8859_1"));
String production=new String(rs.getString("production").getBytes("8859_1"));
String band=new String(rs.getString("awardBand").toString().getBytes("8859_1"));
String time=rs.getString("time");
String number=rs.getString("number");
%>
<br><font color="#ff0000"><%=count%></font>.<br>
<TABLE WIDTH="250" BORDER="1">
<TR><TD>作者姓名:</td><td><%=author%></TD></TR>
<TR><TD>成果名称:</td><td><%=production%></TD></TR>
<TR><TD>获奖级别:</td><td><%=band%></TD></TR>
<TR><TD>获奖时间:</td><td><%=time%></TD></TR>
<TR><TD>证书编号:</td><td><%=number%></TD></TR>
</TABLE>
<%
}
}
%><hr color="#ff8000">鉴定信息:<%
rs=stmt.executeQuery("select * from checkUp where author='"+teacher+"'");
count=0;
while(rs.next()){
if (rs.getString("checkTime").substring(0,4).equals(year)){
count++;
String author=new String(rs.getString("author").toString().getBytes("8859_1"));
String production=new String(rs.getString("production").getBytes("8859_1"));
String band=new String(rs.getString("checkBand").toString().getBytes("8859_1"));
String level=new String(rs.getString("level").toString().getBytes("8859_1"));
String time=rs.getString("checkTime");
String rank=rs.getString("rank");
%>
<br><font color="#ff0000"><%=count%></font>.<br>
<TABLE WIDTH="250" BORDER="1">
<TR><TD>作者姓名:</td><td><%=author%></TD></TR>
<TR><TD>成果名称:</td><td><%=production%></TD></TR>
<TR><TD>鉴定级别:</td><td><%=band%></TD></TR>
<TR><TD>成果水平:</td><td><%=level%></TD></TR>
<TR><TD>鉴定时间:</td><td><%=time%></TD></TR>
<TR><TD>排列名次:</td><td><%=rank%></TD></TR>
</TABLE>
<%
}
}
stmt.close();
con.close();
}catch(ClassNotFoundException e){
System.out.println("未找到要加载的驱动类");
}catch(SQLException e){
System.out.println("SQL错误提示:"+e);
}
%>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -