Clob、NClob转类型工具类

感觉还有很大的改进空间,后续补上吧

public class ClobToObjectUtils {
    /**
     * Clob、nclob类型转Object
     * map:需转换的值
     * wordKey:需转换的key
     * @param map 转换后对象的map集合
     */
    public static Map setClobToObject(Map map, List wordKey) {
        if (map != null) {
            for (String key : wordKey) {
                Clob clobData = (Clob) map.get(key);
                String tempStr = CommonUtils.convertClobToString(clobData);
                String value = "";
                try {
                    byte[] bytes = tempStr.getBytes("utf-8");
                    value = new String(bytes);
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
                map.put(key, value);
            }
        }
        return map;
    }

    /**
     * Clob、nclob类型转Object
     * @param map 转换后对象的map集合
     */
    public static Map setClobToOb

你可能感兴趣的:(Java基础,又吃成长快乐了)