interest_query.jsp

来自「B/S架构的软件项目实训;包括全部详细文档合源程序」· JSP 代码 · 共 37 行

JSP
37
字号
<%@page contentType="text/html;charset=GBK"%>
<%@page language="java" import="java.sql.*"%>
<jsp:useBean id="db" class="bean.ConnDB" scope="page"/>
<html>
<body>
<table border="0" width="100%">
	<tr>    
	<td width="100%"> <p align="center"><b><font size="5" color="#FF9900">利率查询</font></b></td> 
	</tr>
</table>
<HR color="#FF9900">
<p>
<%! float rate; 
    double interest; 
    int per;   
    String cur;%>
<% 
request.setCharacterEncoding("GBK");
per=Integer.parseInt(request.getParameter("period"));
cur=(String)(request.getParameter("currency"));
try{	
	String strQuery="select * from interest where currency='"+cur+"' and period="+per;	
	ResultSet rs=db.executeQuery(strQuery);	
	while(rs.next())
	{		
		rate=rs.getFloat("rate");	
	}  
	db.close();
}catch(Exception e){}%>   
<p>  币种:<%=cur%>
<p>  存期:<%=per%> (月)
<p>  利率:<%=rate%><p>  
 <p><HR color="#FF9900">
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?