ibatis里读取图片blob
配置文件<select id="getTxById" parameterClass="string" >
select tx from txb where id=#id#
</select>java代码
程序代码: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对不对?用ibatis,java 怎么实现读取图片?指教。。。







