java.sql.SQLException:  Protocol violation

Posted on 2004-10-29
Medium Priority
Last Modified: 2013-12-11
Got this error closing a Statement object - what does this error below mean??

java.sql.SQLException:  Protocol violation
   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
   at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
   at oracle.jdbc.ttc7.Oclose.receive(Oclose.java)
   at oracle.jdbc.ttc7.TTC7Protocol.close(TTC7Protocol.java)
   at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java)
Question by:booksplus
1 Comment
LVL 22

Accepted Solution

Helena Marková earned 375 total points
ID: 12470728
If you are using JDBC Thin then this Metalink note can help - Note:66677.1:

When trying to run a JDBC Thin application, it is getting the error:

java.sql.sqlexception Protocol Violation.

Problem Explanation

In most cases, this error is a symptom of a bug.

Below are some of the known bugs that give this error message:

<[BUG:655102]> - caused by attempting to fetch from a column declared as CHAR(254) - fixed in JDBC 8.0.6 (OCI and Thin)

<[BUG:1069768]> - cuased by attempting to receive a struct into a resultset - fixed in JDBC 8.1.7 (OCI) and JDBC 8.1.6(Thin)

<[BUG:1139204]> - caused by binding more then 250 parameters to a statement - fixed in JDBC 8.1.7 (OCI) and JDBC 8.1.6 (Thin)

Below are some other situations that have been known to cause this error:

- When the user password has expired, due to bug:1668134.

- When the JDK versions are not in sync with the proper driver file (classes111.zip, classes12.zip, ojdbc14.jar).

- When the version of the drivers are older than the version of the server.

Problem Solution

In most cases, this error is a symptom of a bug. The causes of each bug are always unique. A test case will need to be generated by the customer to illustrate how to reproduce the problem.

If the cause is known, you would apply the particular Oracle patch.

Always, upgrade the JDBC Driver to the latest version available and see if the problem reproduces before contacting Oracle Support.

Note, if you are using the JDBC OCI driver, the entire Oracle client would need to be upgraded to the latest version.


<[BUG:618721]> java.sql.sqlexception: Protocol Violation on Selecting Large (Amount of) Data
<[BUG:602357]> Protocol Violation Error After Several Operations
<[BUG:1139204]> Protocol Violation if More (Than) 250 Parameters in Callable Statement
<[BUG:655102]> CHAR(254) Datatype Results in Protocol Violation
<[BUG:1069768]> Thin Driver Gives Protocol Violation While Receiving Struct

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

599 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