public class DefaultGplDAO extends HibernateDaoSupport implements GplDAO { public Map updateStatusForCarton(final String cartonLabel, final String status)
Object obj = getJdbcTemplate().execute(new ConnectionCallback(){//在这里设断点可以看到有值
{
public Object doInConnection(Connection conn) throws SQLException, DataAccessException
{
conn.setAutoCommit(true);//方法一到这里参数值就没了
CallableStatement cs = conn.prepareCall("{call TGPLLIB.QAOPENCTN(?,?,?,?)}");
cs.setString(1, cartonLabel);
cs.setString(2, status);
cs.registerOutParameter(3, Types.CHAR);
cs.registerOutParameter(4, Types.CHAR);
cs.execute();
Map map=new HashMap();
map.put(UPDATESTATUS, cs.getString(3));
map.put(UPDATEDETAIL, cs.getString(4));
cs.close();
conn.setAutoCommit(false);
conn.close();
return map;
}
});
return (Map)obj;
}
}
为什么进updateStatusForCarton时参数传递正确有值,但再进这个doInConnection参数的值就没有了,可能会有哪些原因?
以前程序好像是好的,也不没动过这个程序,奇怪了???
Object obj = getJdbcTemplate().execute(new ConnectionCallback(){//在这里设断点可以看到有值
{
public Object doInConnection(Connection conn) throws SQLException, DataAccessException
{
conn.setAutoCommit(true);//方法一到这里参数值就没了
CallableStatement cs = conn.prepareCall("{call TGPLLIB.QAOPENCTN(?,?,?,?)}");
cs.setString(1, cartonLabel);
cs.setString(2, status);
cs.registerOutParameter(3, Types.CHAR);
cs.registerOutParameter(4, Types.CHAR);
cs.execute();
Map map=new HashMap();
map.put(UPDATESTATUS, cs.getString(3));
map.put(UPDATEDETAIL, cs.getString(4));
cs.close();
conn.setAutoCommit(false);
conn.close();
return map;
}
});
return (Map)obj;
}
}
为什么进updateStatusForCarton时参数传递正确有值,但再进这个doInConnection参数的值就没有了,可能会有哪些原因?
以前程序好像是好的,也不没动过这个程序,奇怪了???
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货