📄 mainnews.jsp~33~
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.sql.*" %>
<jsp:useBean id="sqlcb" class="newsreleasesystem.SQLBean" scope="session" />
<%!Connection conn=null; %>
<html>
<head>
<title>
mainnews
</title>
</head>
<body bgcolor="#ffffff">
<table>
<tr>
<td width="900" height="20" bgcolor="ff00ff" align="center" valign="top">Welcome to this news station!</td>
</tr>
<tr>
<td valign="top">
<ul>
<%
try {
if(sqlcb.getCon()!=null){
conn=sqlcb.getCon();
String strSql="select * from SecondLevelTitle";
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery(strSql);
while(rs.next()){%>
<li><%=rs.getString(2) %></li>
<%System.out.println("2");
}
}
}
catch (Exception ex) {
System.out.println(ex.getMessage());
}
%>
</ul>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -