• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Call a stored procedure via JDBC

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks

I need to call a stored procedure from within the java code, I encountred the following error
ORA-00900: invalid SQL statement

I created a procedure that works perfectly I tested it in TOAD


This above procedure executes perfecty under toad



IT gives me res = 50 under toad

Now here is the code in java


This code gives me error exactly at this line



So how to fix that

Thank you







 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
It seems you are not registering the out parameter.
Please check the javadocs and modify the code accordingly and it should work then.

regards,
Amit
 
Ranch Hand
Posts: 228
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
String s="{call getTestData(?, ?)}"; //you have not used "call" to call procedure..

and OUT should be registered as amit said.
refer to this link Callable Statement
 
reply
    Bookmark Topic Watch Topic
  • New Topic