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

📄 inqure2.jsp

📁 这是一个web数据库(运用jsp技术)的课设项目(教师科研信息管理系统),题目和功能实现都在readme.txt文件里有说明.
💻 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 t0=request.getParameter("t0");
	String t1=request.getParameter("t1");
	//System.out.println(t0+","+t1);
	if(t0.equals("") || t1.equals("")){
		out.print("<hr><br><br><center><font color='#ff0000' size='4'>严重错误:日期不能为空!谢谢</font></center>");
	}else{
	int t0Y=Integer.parseInt(t0.substring(0,4));
	int t0M=Integer.parseInt(t0.substring(5,7));
	int t0D=Integer.parseInt(t0.substring(8,10));
	int t1Y=Integer.parseInt(t1.substring(0,4));
	int t1M=Integer.parseInt(t1.substring(5,7));
	int t1D=Integer.parseInt(t1.substring(8,10));
	%>
	<br><br>在 <font color="#0000a0"><%=t0Y%>年<%=t0M%>月<%=t0D%>日和<%=t1Y%>年<%=t1M%>月<%=t1D%>日</font> 之间的 
	<%
	//out.print("t0+","+t1+","+t0Y+","+t0M+","+t0D);
	
	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");
		int count=0;
		%><br>获奖信息:<%
		while(rs.next()){
			String time1=rs.getString("time");
			int timeY=Integer.parseInt(time1.substring(0,4));
			int timeM=Integer.parseInt(time1.substring(5,7));
			int timeD=Integer.parseInt(time1.substring(8,10));
			
			if(timeY>t0Y && timeY<t1Y){
				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>
				<%
			}else if(timeY==t0Y && (timeM>t0M || (timeM==t0M && timeD>=t0D))){
					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>
					<%
				}else if(timeY==t1Y && (timeM<t1M || (timeM==t1M && timeD<=t1D))){
						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");
		count=0;
		while(rs.next()){
			String time1=rs.getString("checkTime");
			int timeY=Integer.parseInt(time1.substring(0,4));
			int timeM=Integer.parseInt(time1.substring(5,7));
			int timeD=Integer.parseInt(time1.substring(8,10));
			if(timeY>t0Y && timeY<t1Y){
				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>
				<%
			}else if(timeY==t0Y && (timeM>t0M || (timeM==t0M && timeD>=t0D))){
					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>
					<%
				}else if(timeY==t1Y && (timeM<t1M || (timeM==t1M && timeD<=t1D))){
						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();
	System.out.println("查询成功!");
	}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 + -