我的ResultSet查詢ResultSet中值是問題處理在Eclipse RCP的
StrQry = "select SUM(isnull(prn_amount,0))as prn_amount,SUM(isnull(adv_prn,0))as adv_prn, SUM(isnull(prv_prn,0))as prv_prn from loan_transaction_mcg where loan_id='1117'";
這是給的結果是基於SQL
- prn_amount = NULL
- adv_prn = NULL
- prv_prn = NULL
,當貸款ID = 1117
ResultSet RsPrincipalDetail = getPaidDetail(loan_id);
while(RsPrincipalDetail.next()){
prn1 = RsPrincipalDetail.getString("prn_amount");
prn2 = RsPrincipalDetail.getString("adv_prn");
prn3 = RsPrincipalDetail.getString("prv_prn");
if(prn1.equals("")){
prn1.equals("0");
}
if(prn2.equalsIgnoreCase("")){
prn2.equals("0");
}
if(prn3.equalsIgnoreCase("")){
prn3.equals("0");
}
我試圖把prn1.equals(空),但仍是空指針異常來。我試圖在prn1調試模式下,它顯示爲null作爲其值。