Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: Protocol violation

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • 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)
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Ya jaenne ,

I am able to run it under SQL Developer tool .

But not with in Servlet .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic