• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Java Database Connectivity

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear friends,

I wanted to know that can we call procedures of oracle 10g from a Java code.
If yes, kindly provide the code.I also wanted to know how from a java code
we can connect to an oracle 10g database.Provide me an instance.
Eagerly waiting for your answers.
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to coderanch..

Please note, javaranch is NotACodeMill..
Also, see ShowSomeEffort..

The things you are asking can be searched on the internet, and if you any doubts/questions after this, please post them here, people will be happy to help you, if you show effort in learning, we can't just give the code..
 
kumar prabhakar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry! But i have already tried to find the answers on internet but could not get clear idea on calling of stored procedure from a java code.So, i thought to post the foolish question.
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's very similar to the way you'd called a user defined stored proc from a SQL Editor. I think you just have to add some extra curly brackets around the stored proc call.

Edit ORA FAQ has a lot of info
 
Sheriff
Posts: 22573
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out java.sql.CallableStatement.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And since you're on Oracle, you could benefit from reading the Oracle Database JDBC Developer's Guide and Reference.

Just make sure not to use any Oracle specific JDBC extensions if you want your code to be "database agnostic", though in general the topic is more complicated than that.
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

kumar prabhakar wrote:Sorry! But i have already tried to find the answers on internet but could not get clear idea on calling of stored procedure from a java code.So, i thought to post the foolish question.



No need to ask sorry and all, you didn't do any mistake here..
Perhaps you could have told, what you searched and tried and what's not working..
However, for the question, as you have been already suggested, please check out java.sql.CallableStatement.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic