• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Calling Stored Procedure within package from Java

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

How to call a stored procedure within an oracle package from Java?

Thanks in advance,
Visu Nekk
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its quite like calling normal stored procedures.
Suppose you have this package:
create or replace package TEST_PACKAGE is
function TEST_PACKAGE_FUNCTION(c1 in double precision, c2 in double precision)
return double precision ;
end TEST_PACKAGE;

you just call it like this:
statement = connection.prepareCall("{ ? = call TEST_PACKAGE.TEST_PACKAGE_FUNCTION(?,?) }");
statement.registerOutParameter(1,java.sql.Types.DOUBLE);
....


Just use the dotted notation.

If you are interested in using stored procedure perhaps you can give a try to my tool spwrapper the netbeans plugin is quite handy to generate the code quickly.
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic