当前位置: 代码迷 >> J2EE >> ,如何把String转换为Clob类型 啊 .
  详细解决方案

,如何把String转换为Clob类型 啊 .

热度:739   发布时间:2016-04-22 01:30:52.0
在线等,怎么把String转换为Clob类型 啊 ...
我代码里面需要把String   类型转换为java.sql.Clob   ,用什么办法可以将他转换过来啊...求高手指点...

------解决方案--------------------
我想应该变成字节流吧 .
------解决方案--------------------
存到数据库就是clob啊
------解决方案--------------------
The Connection interface provides support for the creation of Blob, Clob and
NClob objects using the methods createBlob, createClob and createNClob.
The object that is created does not contain any data. Data may be added to the object by calling one of the setXXX methods on the Blob, Clob or NClob interface.


------解决方案--------------------
CLOB Clob = con.createCLOB()
clob.setString(0,variable-String);
------解决方案--------------------
把String转Clob?

java.sql.Clob c = new javax.sql.rowset.serial.SerialClob( "abc ".toCharArray())
------解决方案--------------------
i收藏
  相关解决方案