问题出在这一块
finally{
try{
if(rs != null) rs.close();
if(ps != null) ps.close();
if(c != null) c.close();
}catch(Exception e){
e.printStackTrace();
}finally是铁定在执行的,
而且是在
System.out.println("findByName_W(): " + v.size());
前执行,rs都已经close,怎么还会有数据?把
System.out.println("findByName_W(): " + v.size());
这句移到
try{}中去
finally{
try{
if(rs != null) rs.close();
if(ps != null) ps.close();
if(c != null) c.close();
}catch(Exception e){
e.printStackTrace();
}finally是铁定在执行的,
而且是在
System.out.println("findByName_W(): " + v.size());
前执行,rs都已经close,怎么还会有数据?把
System.out.println("findByName_W(): " + v.size());
这句移到
try{}中去
上面已经这样的做了。不是这个原因的。 谢谢各位!!!不过还没有结束!!!------------------------------------------------------------------- 问题已经发现了:是在下面这句话: vo.setSoDate((rs.getDate("SO_DATE")).toString());//需要测试!!! 因为有条日期数据为空。
但不明白的是为何在finally中会正确的输出呢?!请继续的探讨!!!
if the "SO_DATE" is null ,it will throw a NullPointerException, so only the finally block will execute.