I am trying to insert a document into oracle12c using SODA lib using example.
I have created a collection using SODA. Now I am trying to insert a document, But I am getting the exception while inserting doc.
Caused by: java.sql.SQLException: Not all return parameters registered
at oracle.jdbc.driver.OracleStatement.processDmlReturningBind(OracleStatement.java:4876)
at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:3101)
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2355)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3579)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3665)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1352)
at oracle.soda.rdbms.impl.TableCollectionImpl.insertAndGet(TableCollectionImpl.java:784)
Code
final OracleCollection countersCollection = database.openCollection(SC_LMS_SEQUENCE_COLLECTION);
countersCollection.insertAndGet(database.createDocumentFromString("{\"id\" : \"COURSE_SEQ\",\"seq\" : 0}"));
Is something I am missing??
The issue is due to the mismatch of ojdbc.jar
.
The official document says,
If you're using JDK8 or above, you could use ojdbc8.jar that ships with Oracle Database 18c. Alternatively, you can also use ojdbc8.jar that ships with OracleDatabase 12.2.0.1. If you're still on JDK7 or even JDK6, you can use ojdbc7.jar or ojdbc6.jar respectively. These ship with Oracle Database 12.1.0.2, and are downloadable from this page.
My project is using JDK 7 and project has custom ojdbc6 jar and version 11.3. Then I replace ojdbc7.jar
(downloaded from this link.) with my custom jar.
Due to this change above exception is gone and the code works well.