📄 teacher_downloadhomework.jsp
字号:
<!--
文件名:student_downloadmodifyhomework.jsp
-->
<%@ page contentType="text/html; charset=gb2312" language="java"
import="java.sql.*"
errorPage=""%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>下载文件列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.STYLE1 {
font-size: 14px;
color: #0000FF;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="99%" cellpadding=0 cellspacing=0 align=center>
<form name=form method=post action="student_downloadmodifyhomework.jsp">
关键词:<input type=text size=12 name=key>
<input type=submit name=submit value="查询" >
</td></tr>
</form>
</table>
<p> </p>
<p align="center" class="STYLE1">下载文件列表</p>
<table width="75%" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#DDF2F8">
<FORM METHOD="POST" ACTION="do_upload.jsp"
ENCTYPE="multipart/form-data">
<%
try{ String user_id=(String)session.getAttribute("user_id");
String sqlStr;
String key;
if(request.getParameter("key")==null || request.getParameter("key").trim()=="")
sqlStr="select top 3 * from n_file where user_id='"+user_id+"'and type='2'order by uploadtime desc";
else
{
key=request.getParameter("key");
sqlStr="select * from n_file where filename like '%"+key+"%' and user_id='"+user_id+"' and type='2' order by uploadtime desc";
}
Connection con;
ResultSet rs;
Statement stmt;
//jdbc
/* //数据库登录用户和密码
String user="sa";
String password="sa";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:jspbook";
con=DriverManager.getConnection(url,user,password); */
//odbc
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String drive = "jdbc:odbc:netteach";
//如果是采用windwos验证方式,则采用下面的语句连接
con = DriverManager.getConnection(drive);
//创建一个jdbc声明
stmt=con.createStatement();
rs=stmt.executeQuery(sqlStr);
while(rs.next())
{
String dfilename=rs.getString("filename");
%>
<tr><td align="center" ><a href="do_download.jsp?dfilename=<%=dfilename%>"><%=dfilename%></a></td>
</tr>
<%
}
}
catch(Exception e){
out.println(e);
}
%>
</table>
</FORM>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -