存储过程中:
select leftPosition,rightPosition,costRate,updateDate,todayCust,nettingProfitloss,todayNetting,
todayflatplate,flatplateProfitloss,todayHand,handProfitloss
into
class_leftAmt,class_rightAmt,class_costAmt,class_updateDate,class_todayCust,class_nettingProfitloss,class_todayNetting,
class_todayflatplate,class_flatplateProfitloss,class_todayHand,class_handProfitloss
from ck_classTotal
where productCode=total_productCode and currencyName=Detail_currencyName and exposureNumber=Detail_exposureNumber for update wait 1;
if SQL%ROWCOUNT = 0 then
RAISE_APPLICATION_ERROR(-20000,'没有数据!');
end if;在java代码中如何取得'没有数据!'这个错误描述呢?
select leftPosition,rightPosition,costRate,updateDate,todayCust,nettingProfitloss,todayNetting,
todayflatplate,flatplateProfitloss,todayHand,handProfitloss
into
class_leftAmt,class_rightAmt,class_costAmt,class_updateDate,class_todayCust,class_nettingProfitloss,class_todayNetting,
class_todayflatplate,class_flatplateProfitloss,class_todayHand,class_handProfitloss
from ck_classTotal
where productCode=total_productCode and currencyName=Detail_currencyName and exposureNumber=Detail_exposureNumber for update wait 1;
if SQL%ROWCOUNT = 0 then
RAISE_APPLICATION_ERROR(-20000,'没有数据!');
end if;在java代码中如何取得'没有数据!'这个错误描述呢?
解决方案 »
- ssh框架搭建问题
- Java EE 和Java Web 有什么区别和联系?
- 用jquery在页面取action中的值(struts2)?
- dom4j不能以http的路径方式读取XML文件问题
- hibernate报错:org.hibernate.MappingException: Could not determine type for: java.lang.string
- 征求计费管理系统
- wls里面自带的jvm突然就宕掉,请大家帮助看看。谢谢。
- 学习J2EE的新手的苦恼
- 在Java窗体上如何才能将数据库中的内容按条件生成报表并打印出来,即如何使用打印功能。
- 三个有关异常的题目比较。。。
- 在线等,jpa怎样指定外键的约束名称
- 请问如何让SVN里的文件当更新时自动添加修改人和comment信息?
DECLARE
noData EXCEPTION;
PRAGMA EXCEPTION_INIT(noData , -20000);
然后在Exception里
EXCEPTION
WHEN noData THEN
.....
这句话貌似是抛异常了啊 java在处理的时候会发现错误 throw exception的 你直接return 2000.在java代码里获取到2000 然后找到2000对应的错误值不就可以了
看下 CallableStatement 用 {? = call sp} ?返回的就是return的状态值