String sql = "select assistnamefile from vouchertransconfig where pk_vtc = '" + confID + "'";
Map ret = (Map) dao.executeQuery(sql, new ResultSetProcessor() {
public Object handleResultSet(ResultSet rs) throws SQLException {
Map<String,Blob> result = null;
try {
if (rs != null ) {
CrossDBResultSet ncrs =(CrossDBResultSet) rs;
Class clazz = ncrs.getClass();
Field f = clazz.getDeclaredField("rs");
f.setAccessible(true);
ResultSet realrs = (ResultSet) f.get(ncrs);
result = new HashMap<String,Blob>();
while (rs.next()) {
result.put("assistnamefile", realrs.getBlob(1));
}
}
} catch (SecurityException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return result;
}
});
------解决方案--------------------
比较有可能的是两次执行的confId不一样,
你在执行dao.executeQuery前先把sql打印出来看看。