?? inqure3.jsp
字號(hào):
<%@ 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> 老師的在研項(xiàng)目信息:<%
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>項(xiàng)目名稱:<%=production%>
<LI>項(xiàng)目級(jí)別:<%=band%>
<LI>項(xiàng)目金額:<%=money%>元
<LI>開始年份:<%=t0%>
<LI>終止年份:<%=t1%>
</UL>
<%}
stmt.close();
con.close();
}catch(ClassNotFoundException e){
System.out.println("未找到要加載的驅(qū)動(dòng)類");
}catch(SQLException e){
System.out.println("SQL錯(cuò)誤提示:"+e);
}
%>
</BODY>
</HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -