Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

java.sql.SQLException: Protocol violation

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am doing a SQL Operation (Select ) inside my servlet .
The query is simple select (Select sal from emp)
I am getting java.sql.SQLException: Protocol violation

Please tell me why i am getting this exception :

Protocol violation
java.sql.SQLException: Protocol violation
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.ja
va:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:1
33)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:263)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:271)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:445)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1053)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:
780)
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.jav
a:855)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1187)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
1378)
at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatemen
tWrapper.java:387)
at TestServlet.doGet(TestServlet.java:45)
 
author & internet detective
Posts: 40913
840
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ravi,
Let's try to narrow down the problem. Are you able to:
1) Run the SQL statement from the Oracle command line?
2) Run a different SQL statement in Java?
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya jaenne ,

I am able to run it under SQL Developer tool .

But not with in Servlet .
reply
    Bookmark Topic Watch Topic
  • New Topic