📄 collegeinfofile.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="java.sql.*" %>
<%@ page import="DataBaseConnection.OracleConnection" %>
<center>
<P><font color=blue size=+3>院校信息</font></p>
<%
//获取连接对象和语句对象
Connection conn = null;
Statement stmt = null;
String user = "sox";
String password = "123";
OracleConnection oc = new OracleConnection( user, password );
try{
conn = oc.getConnection();
stmt = conn.createStatement();
}
catch( SQLException e ){ System.out.println( e.getMessage()+"374" ); }
//判断存不存在该编号的考生
String sql = "select * from college order by 院校编号";
ResultSet rs = stmt.executeQuery( sql );
%>
<table border="1">
<tr bgcolor="#FFCC99">
<th nowrap>院校编号</th>
<th nowrap>院校名称</th>
<th nowrap>录取分数线</th>
<th nowrap>招生人数</th>
<th nowrap>录取人数</th>
</tr>
<%
int i=0;
while( rs.next() ){
i++;
out.print( "<tr> <td>"+rs.getString(1)+"</td><td>"+
rs.getString(2)+"</td><td>"+rs.getString(4)+"</td><td>"+rs.getString(5)+
"</td><td>"+rs.getString(6)+"</td><td>" );
}
%>
</table>
<BR><FONT color="blue">总共有<%=i%>条院校信息</FONT>
</center>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -