Reputation: 805
I have a string in java, but the datatype in database is Clob. How do i get a Clob from String?
Upvotes: 5
Views: 33665
Reputation: 1
To Convert any String(small strings or big JSON converted to strings) in to CLOB we need to initialize CLOB first:
CLOB clob = (CLOB) con.createClob();
clob.setString(position, "Any String Here");
Where con
is Connection
Upvotes: 0
Reputation: 27164
clob.setString(position, string)
writes a String to a Clob object.
Upvotes: 8