Java从数据库取出BLOB数据放入map中,从map中拿出转换成String类型数据

来源:互联网 发布:如何玩淘宝众筹 编辑:程序博客网 时间:2024/05/21 07:50
for (Map<String, Object> map:list){            **Blob blob=((BLOB) map.get("FILEDATA"));**//得到并强转成BLOB            String content="";            try {                **content = new String(blob.getBytes((long)1, (int)blob.length()));**//转成String            } catch (SQLException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }
0 0
原创粉丝点击