create or replace function GET_PERFORMANCE_COEFFICIENT(PERFORMANCE_SCORE number) return number is --获取绩效系数 coefficient number(10,2); maxScore number(10,2); begin select max(hign_score) into maxScore from PERFORMANCE_RULE; select p.coefficient into coefficient from PERFORMANCE_RULE p where (PERFORMANCE_SCORE<p.hign_score and PERFORMANCE_SCORE>=p.lower_score) or (PERFORMANCE_SCORE = maxScore and p.hign_score = maxScore) ; return coefficient; exception when no_data_found then RAISE_APPLICATION_ERROR(-20002, "未找到绩效系数"); end; 上面的做法就可以让我们的JAVA程序捕获到异常了2.JAVA端