📄 inqure3.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 teacher=request.getParameter("name");
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 onStudy where author='"+teacher+"'");
int count=0;
teacher=new String(teacher.toString().getBytes("8859_1"));
%><hr><font color="#0000a0"><%=teacher%></font> 老师的在研项目信息:<%
while (rs.next()){
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("itemBand").toString().getBytes("8859_1"));
if(band.equals("null"))band="";
double money=rs.getDouble("itemMoney");
String t0=rs.getString("t0").substring(0,4);
String t1=rs.getString("t1").substring(0,4);
%>
<UL>
<br><font color="#ff0000"><%=count%></font>.<br>
<LI>主 持 人:<%=author%>
<LI>项目名称:<%=production%>
<LI>项目级别:<%=band%>
<LI>项目金额:<%=money%>元
<LI>开始年份:<%=t0%>
<LI>终止年份:<%=t1%>
</UL>
<%}
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 + -