• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

SQL exception with ojdbc8 Jar

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

  When I change the POM to use ojdbc8 Jar then I am getting the below error

2017-08.18 04:42:02.647-0700: ERROR: Failed to create status log entry: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO table name (s_id, f_id, p_id, t_type, d_addr, st, desc, f_size) VALUES (88568, ?, ?, ?, ?, ?, ?, ?)]; SQL state [99999]; error code [17068]; Invalid argument(s) in call; nested exception is java.sql.SQLException: Invalid argument(s) in call
2017-08.18 04:42:02.647-0700: CAUSE: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO table name (s_id, f_id, p_id, t_type, d_addr, st, desc, f_size) VALUES (88568, ?, ?, ?, ?, ?, ?, ?)]; SQL state [99999]; error code [17068]; Invalid argument(s) in call; nested exception is java.sql.SQLException: Invalid argument(s) in call
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO QA_DF_OWNER.df_statuslog (stl_id, feed_id, partner_id, trans_type, dest_addr, status, description, file_size) VALUES (88568, ?, ?, ?, ?, ?, ?, ?)]; SQL state [99999]; error code [17068]; Invalid argument(s) in call; nested exception is java.sql.SQLException: Invalid argument(s) in call
       at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
       at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
       at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)
       at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:843)
       at org.springframework.jdbc.object.SqlUpdate.update(SqlUpdate.java:188)

Caused by: java.sql.SQLException: Invalid argument(s) in call
       at oracle.jdbc.driver.AutoKeyInfo.getNewSql(AutoKeyInfo.java:187)
       at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:4342)
       at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:807)
       at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:807)

Any clue  what could be the reason?

Regards
Abhishek

   
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What Oracle version are you talking to?

I'm wondering if you have a mismatch between your JDBC driver and your Oracle db.
 
Abhishek Rath
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Oracle DB version is 12.1.0.2.0 SELECT version FROM V$INSTANCE

The Spring Version used here is 3.1.1 .
 
Bartender
Posts: 598
26
Oracle Notepad Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are the query values, and have you tried running the query directly? With a type mismatch, both the input and output should be looked at.
 
Dave Tolls
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't the query.
The error is coming from the prepareStatement call.
(Had a whole reply based on it being from the execution!)

Where did you get the ojdbc8 jar from?
If I go to the Oracle 12 driver download page the driver is 7 (or 6 if you're on an earlier JDK).
 
Brian Tkatch
Bartender
Posts: 598
26
Oracle Notepad Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Tolls wrote:This isn't the query.
The error is coming from the prepareStatement call.
(Had a whole reply based on it being from the execution!)



Good catch, Dave! I need to read those traces more carefully.
 
Abhishek Rath
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the POM file we have it defined

         <dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>

The earlier version was

<groupId>com.oracle</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>12.1.0.2</version>
     </dependency>

The JDK is 1.8.

So for this version of Oracle and JDL , do we need to use ojdbc7 not ojdbc8?
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if you look at the link I gave to the Oracle 12 JDBC page that shows you the versions they recommend.
 
Abhishek Rath
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your database encoding? Something different than UTF?
Have you seen this https://support.oracle.com/knowledge/Middleware/2278611_1.html ?


PrepareStatement(string, String[]) Failing Due To Upgrade From Ojdbc7 To Ojdbc8 With "java.sql.SQLException: Invalid argument(s) in call" Error

On : 12.2.0.1.0 version, Thin JDBC driver

When using the Oracle JDBC driver to issue a prepared statement that returns auto-generated keys, this operation fails when the NLS_CHARACTERSET on the targeted database is WE8ISO8859P15


 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic