?? ratesearch.jsp
字號:
<%@page contentType="text/html"%><%@page pageEncoding="UTF-8"%><%@page import="java.sql.*"%><%--The taglib directive below imports the JSTL library. If you uncomment it,you must also add the JSTL library to the project. The Add Library... actionon Libraries node in Projects view can be used to add the JSTL 1.1 library.--%><%--<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> --%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>利率牌價</title> </head> <body background="D:/YJ/YJ1.23/NetBank/background/b065.gif"> <p align="center"> <font face="隸書" color="blue" size=3>利率牌價</font> <p align="center"> <% String rate = ""; String inTime = ""; String dbUrl = "jdbc:odbc:afei"; String user = "scott"; String password = "tiger"; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn = DriverManager.getConnection(dbUrl,user,password); String sql = "Select * from LimitRate"; Statement stat = conn.createStatement(); ResultSet result = stat.executeQuery(sql); %> <font face="隸書" color="blue" size=3> <table border="1" width="500" cellspacing="2" cellpadding="1"> <tr> <td>存款年限</td><td>存款利率</td> </tr> <% while(result.next()) { inTime = result.getString("inTime"); rate = result.getString("rate"); out.println("<tr>"); out.println("<td>"); out.println(inTime); out.println("</td>"); out.println("<td>"); out.println(rate); out.println("</td>"); out.println("</tr>"); } %> </table> <% } catch(Exception connectException) { out.println("連接數據庫失敗! 請與管理員聯系!"); } %> </font> </body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -