>java.sql.SQLException: Protocol violation


I am getting protocol violation while updating data in the database. However it works from different machine perfectly fine.
Exception is as follows :
>java.sql.SQLException: Protocol violation

Also, it works fine if the following line is commented in code.
// AvailabilityStatsBean statusResponse = getAvailibilityStats(orderBean);

The data gets perfectly updated to the database with an irrelevant line being commented.

Does this exception occur due to incorrect java versions. The oracle driver we are using is ojdbc14.jar

Kindly assist.

Who is Participating?
CetusMODConnect With a Mentor Commented:
PAQed with points refunded (250)

Community Support Moderator
The Thin driver throws this exception when it reads something from the RDBMS that it did not expect. This means that the protocol engine in the Thin driver and the protocol engine in the RDBMS are out of synch
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

By adding  the classes12.jar to your project properties java libraries will solve the problem.
Mayank SAssociate Director - Product EngineeringCommented:
I think it is already in the Java libraries included otherwise it would've thrown class not found exception for the driver or data-source SQL exception saynig unable to load driver.
immortalageAuthor Commented:

The problem got resolved by replacing the ojdbc14.jar with the latest version and adding two parameters to the virtual machine
"-Duser.language=en -Duser.country=US" (there is a bug in this driver and it fails if locale is not set).
The bug in this driver corrupts the connection thereby we are not able to perform any further transactions using the same connection.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.