I have ORA-01756 error using ojdbc7.jar in Tomcat

85 views Asked by At

A few weeks ago I started having this error in my connections from tomcat to Oracle:

Caused by: java.sql.SQLException: Locale not recognized

Trying the following configurations in the jvm didn't seem to fix it:

-Duser.language=es -Duser.region=ES

so I contacted Oracle support and they provided me with the patch p30649766_121020

After applying it, the error is considerably smaller and has disappeared, with the following error appearing instead: Caused by: java.sql.SQLException: ORA-00604: se ha producido un error a nivel 1 de SQL recursivo ORA-01756: la cadena entrecomillada no está terminada correctamente

From oracle do not locate the error.

I have tried to reproduce the error directly with some of the queries but without success.

What I have achieved is, by means of a network capture, to see that when the error occurs, the following string appears:

ALTER SESSION SET TIME_ZONE='Europe/MadridSESSION_CLIENT_LOBATTR1SESSION_CLIENT_DRIVER_NAMEjdbcthin

And when done correctly, I see the following:

ALTER SESSION SET TIME_ZONE='Europe/Madrid' NLS_LANGUAGE='SPANISH'  NLS_TERRITORY='SPAIN'SESSION_CLIENT_LOBATTR1SESSION_CLIENT_DRIVER_NAMEjdbcthin

In the first string a quotation mark is missing. It is not something that I have managed to reproduce directly, since the error is random.

It seems to be a problem with the driver since it is a query launched by the driver before the query launched by my application. Has this happened to anyone before?

After one of the comments of this post, I tried to user another versions of the driver:

java -jar ojdbc8.jar Oracle 19.22.0.0.0 JDBC 4.2 compiled with javac 1.8.0_391 on Sun_Oct_29_03:24:04_PDT_2023 

java -jar ojdbc8.jar 
Oracle 23.3.0.23.09 JDBC 4.2 debug compiled with javac 1.8.0_381-ea on Thu_Aug_31_22:00:13_PDT_2023

[Default Properties Resource]
#Default Connection Properties Resource
#Thu Mar 14 10:09:03 CET 2024

I have the same error, seems to be less frequently.

My oracle version is: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0

Tomcat: 8.5

0

There are 0 answers