![]() |
#2
tangkou2010-11-03 14:37
回复 楼主 tangkou
|
<select id="getTxById" parameterClass="string" >
select tx from txb where id=#id#
</select>
java代码select tx from txb where id=#id#
</select>

public byte[] getImage(String id){
byte[] image = null;
try {
image = (byte[]) sqlMap.queryForObject("getTxById",id);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return image;
}
这个肯定错啦 ,,没经验。第一次做读取图片,不知道用sqlMap.queryForObject对不对?byte[] image = null;
try {
image = (byte[]) sqlMap.queryForObject("getTxById",id);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return image;
}
用ibatis,java 怎么实现读取图片?指教。。。