This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes StoredProcedure on a DBLink. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "StoredProcedure on a DBLink." Watch "StoredProcedure on a DBLink." New topic

StoredProcedure on a DBLink.

Kalyana Chakravathy

Joined: Nov 04, 2009
Posts: 8
I am pretty new to JDBC and hibernate, might be stupid so please don't get angry. I need to run a stored procedure on a DB via a DBLink because of direct access restrictions. I came to know about it only after I wrote some code with the expectation it will work. I use spring JDBC to call the stored procedure. Now I don't know how can change this to call the stored procedure on the DB link.

As you see there is nothing here that says run over this DBLink. How to specify it. I did some googling but got nothing, except one says PROC@remote_address(?, ?, ?)
but that involves manually opening a connection and making a call like
I don't want to change this code as spring takes care of much stuff. Help with the Stored Procedure to run over DBLink please.

Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Hi Kalyana,

You may create a procedure that calls the actual procedure over db link.


Kalyana Chakravathy

Joined: Nov 04, 2009
Posts: 8
Hi Fatih,

I cannot make a stored procedure in DB1 to call the stored procedure in DB2, as the DB part is not owned and it has been decided this way. I cannot make a call on DB1 but only onDB2 via the DB link on DB1. Can you tell me if the below code will work correctly.

I agree. Here's the link:
subject: StoredProcedure on a DBLink.