📄 searchsum.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/abenhsh0012.gif"> <% String loginID = (String)session.getAttribute("userName"); String accountSum = ""; String rateMoney = ""; 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 accountSum,rateMoney from deAccount,netMember where deAccount.accountID = netMember.accountID and loginID = '"+loginID+"'"; Statement stat = conn.createStatement(); ResultSet result = stat.executeQuery(sql); while(result.next()) { accountSum = result.getString("accountSum"); rateMoney = result.getString("rateMoney"); %> <font face="隶书" color="blue" size=3> <p align="center"> 您的帐户余额如下: <p align="center"> <table border="1" width="500" HEIGHT="80" cellspacing="0"> <tr> <td>剩余金额</td> <td>利息</td> </tr> <tr> <td><%=accountSum%></td> <td><%=rateMoney%></td> </tr> </table> <% } conn.close(); } catch(Exception connectException) { out.println("连接数据库失败! 请与管理员联系!"); } %> </font> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -