1//declare a temporary ResultSet variable
2ResultSet tempRsExchCD = null;
3//first condition:fallback.extract exch cd for the nearest postal cd
4 ps_omop_getexchcd.setString(1,stTempPostalCd);
5 ps_omop_getexchcd.setInt(2,stTempPostalCd.length());
6 rsGetExchCD = ps_omop_getexchcd.executeQuery();
7
8 if(rsGetExchCD.next())
9 {
10 tempRsExchCD = rsGetExchCD;
11 }
12 else
13 {
14 //second conditon:upward.extract exch cd for the nearest postal cd
15 ps_omop_getminexchcd.setString(1,stTempPostalCd);
16 ps_omop_getminexchcd.setInt(2,stTempPostalCd.length());
17 rsMingetExchCD = ps_omop_getminexchcd.executeQuery();
18 tempRsExchCD = rsMingetExchCD;
19 }
20 //tempRsExchCD = rsGetExchCD.next()?rsGetExchCD:rsMingetExchCD;
21
22 if(tempRsExchCD.next())
23 {
24 ……
25 ……
问题:第一种情况,当rsGetExchCD.next()为“真”时,程序应该执行第10行,第22行以及以下
第二种情况,当rsGetExchCD.next()为“假”时,程序应该执行12-18行及以下。
实际上第一种情是,第三10行可以执行,但到了第22行时程序跳出。而第二种情况正确执行。我不知道问题出在哪里,请各位兄弟们提点意见,谢谢。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货