I want to insert a String via a Java Program into Oracle DB
in a table having column type as CLOB
. I am using the following code
PreparedStatement stmt=conn.prepareStatement("insert into Json_Test values(?,?)");
stmt.setInt(1,counter);
stmt.setClob(2,new StringReader(s));
But while executing i am getting an Exception: java.lang.Exception: 1 - oracle.jdbc.driver.OraclePreparedStatementWrapper.setClob(ILjava/io/Reader;
Can you say jdbc version you are using? It works correctly to me with
dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.