用 Apache Geronimo 和 Axis2 实现在线银行,第 2 部分: 服务:填充内容(下)
2010-03-19 00:00:00 来源:WEB开发网查看贷款申请表的状态
客户总是迫切希望查看他们的贷款申请是否已被接受。更新查看贷款申请表状态操作,如 清单 23 所示。
清单 23. 查看贷款申请表状态
public com.example.www.onlinebanking.xsd.
ViewLoanApplicationStatusResponseDocument
ViewLoanApplicationStatus
(com.example.www.onlinebanking.xsd.
ViewLoanApplicationStatusDocument param4 )
throws AxisFault{
ViewLoanApplicationStatusDocument.
ViewLoanApplicationStatus req =
param4.getViewLoanApplicationStatus();
ViewLoanApplicationStatusResponseDocument res =
ViewLoanApplicationStatusResponseDocument.
Factory.newInstance();
ViewLoanApplicationStatusResponseDocument.
ViewLoanApplicationStatusResponse res2 =
res.addNewViewLoanApplicationStatusResponse();
String username = matchUserNameToToken(req.getToken());
if(username == null) throw new AxisFault("Invalid token!");
ArrayList statuses = new ArrayList();
try{
String sql = "select * from loanapplications "+
"where username=?";
PreparedStatement statement = conn.prepareStatement(sql);
statement.setString(1, username);
ResultSet results = statement.executeQuery();
while(results.next()){
LoanApplicationStatus l = LoanApplicationStatus.
Factory.newInstance();
l.setLoanNumber(Integer.toString
(results.getInt("loannumber")));
String val = results.getString("approved");
if(val.equals("true"))
l.setApproved(true);
else
l.setApproved(false);
val = results.getString("denied");
if(val.equals("true"))
l.setDenied(true);
else
l.setDenied(false);
statuses.add(l);
}
} catch(Exception e){
e.printStackTrace();
}
LoanApplicationStatus statusesA[] =
new LoanApplicationStatus[statuses.size()];
for(int i = 0; i < statuses.size(); i++){
statusesA[i] = (LoanApplicationStatus)statuses.get(i);
}
res2.setStatusArray(statusesA);
return res;
}
- ››apache设置域名绑定 以及绑定不起作用的排查
- ››apache rewrite将指定URL转向指定的几个服务器
- ››apache配置文件httpd.comf部分参数说明
- ››Apache+Mysql+PHP+phpMyAdmin+Mac OS X 10.7 Lion...
- ››apache+tomcat负载均衡_项目实例
- ››apache mysql php 源码编译使用
- ››Apache添加mod_aspdotnet.so支持ASP.NET配置指南
- ››Apache中改变php.ini的路径
- ››Apache2.2与Tomcat6整合及虚拟主机配置
- ››Apache+php+mysql在windows下的安装与配置图解
- ››Apache+Subversion完美结合,CentOS下实现版本控制...
- ››Apache HTTPServer2.2.16 发布
赞助商链接