1、String 转 Blob:
String a= "Hello World!";
Blob blob = Hibernate.createBlob(a.getBytes(Charset.forName("utf-8")));
2、Blob 转 String:
Blob blob;
try{
String content = new String(blob.getBytes((long)1, (int)blob.length()));
} catch(SQLException e) {
e.printStackTrace();
}
字符串与blob、clob互转
猜你喜欢
转载自blog.csdn.net/u012444184/article/details/50535579
今日推荐
周排行