1. 1、String 转 Blob:  
  2.   
  3.     String content = "Hello World!";  
  4.   
  5.     Blob blob = Hibernate.createBlob(content.getBytes());  
  6.   
  7. 2、Blob 转 String:  
  8.   
  9.     Blob blob;  
  10.   
  11.     try{  
  12.          String content = new String(blob.getBytes((long)1, (int)blob.length()));  
  13.     } catch(SQLException e) {  
  14.          e.printStackTrace();  
  15.     } 

相关文章:

  • 2021-12-24
  • 2021-10-12
  • 2021-06-30
  • 2022-12-23
  • 2021-12-14
  • 2021-09-26
猜你喜欢
  • 2021-06-14
  • 2021-12-09
  • 2021-12-08
  • 2021-10-07
相关资源
相似解决方案