This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Database Connectivity

 
kumar prabhakar
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Prasad Krishnegowda
Ranch Hand
Posts: 665
4
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Carlo Moore
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out java.sql.CallableStatement.
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • 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: 665
4
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic