• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring JDBC and ORACLE: Looking for a way to pass a BOOLEAN to a stored procedure

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings all.
My question is not strictly related to Spring's JDBC but since this is what I use at the moment, here it comes..

I want to call an ORACLE stored procedure that has as second parameter a BOOLEAN parameter.

PROCEDURE run_job(job_name IN VARCHAR2,
use_current_session IN BOOLEAN DEFAULT TRUE);



I am calling it like this


My problem is a known one, ORACLE does not have a 'real' boolean type and so it simulates it with integers.
I tried registering "USE_CURRENT_SESSION" parameter as boolean, integer, tried with java.sql types, oracle.jdbc types - all for nothing.

I don't want to make a workaround for this, like wrapping the procedure. I want a correct, programmatic way of passing a boolean to a stored procedure.

If someone can help me with an idea I would be grateful.

Thank you





 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you guessed, this is not a Spring problem, but a JDBC problem. Spring cannot help you fix that. As you said, this is a known issue. You'll have to wrap the procedure, whether you want it or not
 
Ioan Damian Sirbu
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There must be a way.

ORACLE has a stored function made for this one purpose: converting int to booleans


Maybe pass it as a function from JDBC?


 
reply
    Bookmark Topic Watch Topic
  • New Topic