Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String to Clob in Java?

Tags:

java

I have a string in java, but the datatype in database is Clob. How do i get a Clob from String?

like image 793
fR0DDY Avatar asked Jan 14 '11 03:01

fR0DDY


2 Answers

clob.setString(position, string) writes a String to a Clob object.

like image 153
Vijay Mathew Avatar answered Oct 06 '22 21:10

Vijay Mathew


new javax.sql.rowset.serial.SerialClob(source.toCharArray())

like image 31
Stan Sokolov Avatar answered Oct 06 '22 23:10

Stan Sokolov