I am trying to convert String to Clob for storage in a database. I have the following code:
Clob clob = connection.createClob();
System.out.println("clob before setting: " + clob);
clob.setString(1,"Test string" );
System.out.println("clob after setting: " + clob);
System.out.println("clob back to string: " + clob.toString());
When I run this, Clob is not installed, the output is as follows:
clob before setting: org.apache.derby.impl.jdbc.EmbedClob@1f5483e
clob after setting: org.apache.derby.impl.jdbc.EmbedClob@1f5483e
clob back to string: org.apache.derby.impl.jdbc.EmbedClob@1f5483e
Anywhere I look, the setString method is used, I have no idea why this does not work for me.
source
share