0
votes

I appreciate if anyone can help me fixing this issue:

Getting java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-01003: no statement parsed exception

I tried executing the stored procedure from toad and it gives me proper exception as table or view does not exists, but when the stored procedure it executed from Java I'm getting this issue. Can anyone tell is this Java issue ?

Stored procedure that I'm calling takes input parameters. Cannot share the stored procdure.

1
"My car won't start. Please fix my car...but you can't look at it".tilley31
You can get that error if the parameters are passed out of order.Steve Greene
@tilley31 - I understand what you are saying. I'm sorry i couldn't share because it is client's code and it is confidential. I'm trying to find what can be possible solutions.Dinesh K
@SteveGreene- thanks for providing one of the possible solution. Parameter order is correct.Dinesh K

1 Answers

2
votes

The ORA-01003 error suggests that you are not passing a parseable statement over JDBC for Oracle to process. Please check that your Java code is calling the procedure correctly.

Because you haven't disclosed any details about the procedure (incl. the number and types of parameters), it's hard to give specific suggestions; below is an example snippet of how to call procedure my_procedure that gets two parameters as input.

private static final String CALL_PROCEDURE = "{ call my_procedure(?, ?) }";
...
private void callMyProcedure(Connection c) throws SQLException {
  CallableStatement cs = null;
  try {
    cs = c.prepareCall(CALL_PROCEDURE);
    cs.setString(1, "firstValue");
    cs.setString(2, "secondValue");
    cs.execute();
  } finally {
    if (cs != null) {
      cs.close();
    }
  }
}