>java.sql.SQLException: Protocol violation

Posted on 2006-06-02
Last Modified: 2012-06-27

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.

Question by:immortalage
    LVL 92

    Expert Comment

    LVL 14

    Expert Comment

    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
    LVL 8

    Expert Comment

    By adding  the classes12.jar to your project properties java libraries will solve the problem.
    LVL 30

    Expert Comment

    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.

    Author Comment


    The problem got resolved by replacing the ojdbc14.jar with the latest version and adding two parameters to the virtual machine
    "-Duser.language=en" (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.

    Accepted Solution

    PAQed with points refunded (250)

    Community Support Moderator

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now