我需要从数据库检索数据,如果没有在dB中找到数据我需要在java中激发一个弹出窗口。即时通讯给我在这里写的代码来处理,但无法处理它。java异常处理
String SectorCode = employerProfile.getSectorCode().getSectorTypeId();
String IndustrialCode = employerProfile.getIndustrialCode().getIndustryTypeId();
try{
if(SectorCode==null || IndustrialCode==null){
JOptionPane.showMessageDialog(null, "Record not found");
}
}catch(Exception ex){
ex.printStackTrace();
}
请给我建议的解决方案... 在此先感谢
那么,什么是真正的问题?它抛出异常吗?没有看到对话框? – 2010-12-15 06:32:34
是它的抛出异常...但用户需要弹出窗口,当没有文件存在dB .. – charan 2010-12-15 06:36:23
@ charan ...当这个调用抛出异常...可能是incase没有找到记录.. ?? M我...? – water 2010-12-15 06:38:16