wood burning stoves 2.0*
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
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.

Don't get me started about those stupid light bulbs.
subject: StoredProcedure on a DBLink.
Similar Threads
Retrieve Number of Rows Affected in Calling Stored Procedure
java.sql.SQLException: Output parameters have not yet been processed. Call getMoreResults()
Strange problem calling oracle function with spring
Can a oracle Stored procedure return a cursor as a return value?
Problem: Spring - Stored Procedure call