Oracle SODA : Not all return parameters registered - oracle

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.

Related

Spring Batch Meta-Data Schema for Oracle

Where can I found the sql to create in my database all the metadata sctructures needed by The Spring Batch framework.
The application don't have the permission on the database to outgenerate them.
As suggested in the documentation I've try to use the sql provided in the org.springframework.batch.core repository
but it's seems to be uncomplete.
For example it misses the column BATCH_JOB_EXECUTION .JOB_CONFIGURATION_LOCATION VARCHAR(2500), which on the other hand it's present in the documentation snippet
I've understand that this structure comes with the newest vesion 4.1 but also the (migration script)[https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/4.1/migration-oracle.sql] doesn't seem to be right since it supposed that the column it's already there:
ALTER TABLE BATCH_JOB_EXECUTION MODIFY JOB_CONFIGURATION_LOCATION VARCHAR2(2500 char);
Where can I found the complete oracle sql script that creates the structure needed by the framework version 4.3.6 ?
If you look at https://github.com/spring-projects/spring-batch/blob/4.3.x/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-oracle10g.sql you can see the BATCH_JOB_EXECUTION.JOB_CONFIGURATION_LOCATION column. So you can use /org/springframework/batch/core/schema-oracle10g.sql from the classpath since it is included in spring-batch-core-4.3.6.jar.

how to update snowflake driver in Talend open studio 7.2

Snowflake has recently updated launched JDBC Driver 3.12.x . However the talend open studios is still have 3.6.3 JDBC jar.
Is there a mechanism in talend to change the JDBC driver?
I tried updating the xml file but still the JDBC driver my job was picking up 3.6.3
You could use the Talend/Modules view to modify the JDBC driver, using a custom MVN URI. This is done at the project level.
You said it's picking 3.12x. I am assuming its a typo from your side.
What component you are using to connect to snowflake using talend ?
If this is not the tSnowflakeConnection.
Then you have couple of other talend components like(remember you can do all whatever you are doing using these components)
tJdbcRow
tJdbcConnection
Now if you want to use any of the above component they all allow you to add the driver jar.
Download the intended jar of your choice and use that in the above components instead.
Please let me know if this helps.

Grails 3.1.8 Oracle JDBC Driver configuration

I am trying to connect the Oracle Express Edition 11g through Grails 3.1.8. I tried all possible solutions:
Downloaded the jar file(ojdbc14.jar)
Adding a pom.xml to my sample application.
Searched the entire web for solution.
I was not able to achieve the connectivity between Grails3.1.8 and Oracle.
The only error I see is:
https://repo.grails.org/grails/core/com/oracle/ojdbc14/10.2.0.4.0/ojdbc14-10.2.0.4.0.jar (Use --stacktrace to see the full trace
Always use the latest JDBC driver in your application. JDBC driver is backward compatible with lower versions of the database. You can download the latest drivers from this path.

ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6 cannot be cast to OraclePreparedStatement

I'm working to migrate an application from Oracle Application Server to JBoss EAP 6.1. I have most things working but I am getting one error that I haven't been able to figure out:
13:27:29,743 ERROR [com.myproj.db.dao.myDao] (Thread-164) Get Prepared Statement:
java.lang.ClassCastException:
org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6 cannot be cast
to oracle.jdbc.internal.OraclePreparedStatement
I have Oracle set up as a module in JBoss for connection pooling using ojdbc6.jar (and it works for other parts of the application), but for the one part of the application that uses an OraclePreparedStatement, it gets the error.
I did make certain that there is no ojdbc6.jar file in the WAR file. The only one in JBoss seems to be inside of the module.
I did try changing the OraclePreparedStatement class to oracle.jdbc.OraclePreparedStatement, but the results are the same.
I did try running with TRACE on for logging to see where classes were loading from. OraclePreparedStatement was loaded from the module with the exception of this line:
4:31:40,583 TRACE [org.jboss.modules] (Thread-84) Finding class
oracle.jdbc.OraclePreparedStatement from Module "deployment.myProj.war:main" from
Service Module Loader
Here's a link to an excerpt of the log - basically just the lines related to OraclePreparedStatement.
I have confirmed that there is no ojdbc6.jar (or any Oracle related jars) in the WAR file, and there is no OraclePreparedStatement class inside of the WAR file either.
I do have the module listed as a dependency in my JBoss deployment structure xml file.
Anyone have any ideas?
From looking at the javadoc I would guess that org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6 is wrapping the underlying Oracle JDBC driver.
org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6 has a method to get the underlying statement. Perhaps you should try something like the following:
WrappedPreparedStatementJDK6 statement = ...
OraclePreparedStatement oracleStatement = (OraclePreparedStatement)statement.getUnderlyingStatement();

Playframework 2 with Oracle throws InvocationException

When running the "java/computer-database" sample with an Oracle db instead of the H2 one, Computer.find.byId() results in "com.sun.jdi.InvocationException occurred invoking method.".
The Application.list() is showing the correct data.
I have this in my application.conf:
db.default.url="jdbc:oracle:thin:#xx.xx.xx.xx:1521:somename"
db.default.driver=oracle.jdbc.driver.OracleDriver
In my lib directory I have
ojdbc6.jar
orai18n.jar
When searching for examples on how to use oracle in playframework 2.0, I noticed that you should have a line similar to this one in application.conf:
jpa.dialect=org.hibernate.dialect.Oracle11gDialect
However, this (or any other version number I can come up with) gives an error :
PersistenceException: No Persistence provider for EntityManager named org.hibernate.dialect.Oracle10gDialect
I have already placed hibernate-3.3.2.jar in my lib folder, but somehow play is not using it.
Does anybody know how to fix this, so I can use oracle with the play! framework 2.0?

Resources