This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JDBC and the fly likes Correct approach ? Stored Proc (returning cursor) Vs Prepared statment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Correct approach ? Stored Proc (returning cursor) Vs Prepared statment" Watch "Correct approach ? Stored Proc (returning cursor) Vs Prepared statment" New topic
Author

Correct approach ? Stored Proc (returning cursor) Vs Prepared statment

prasad kulkarni
Ranch Hand

Joined: Mar 19, 2006
Posts: 66
I have lot of select queries to integrate with my java code.

I have two options to select within :

1. Store procedure which returns cursor
2. Prepared statements

Which one should I use ? Which one is the fastest and a correct approach?

Can java experts please put some pros and cons of both approaches?


scjp, scwcd
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2477
    
    7

1 is proprietary , 2 is portable across databases.

OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Correct approach ? Stored Proc (returning cursor) Vs Prepared statment
 
Similar Threads
Get cusor from SQLServer StoreProcedure to Java Program
urgent help reqd
Connection.close() and preparedStatement.close() in Connection.TRANSACTION_SERIALIZABLE mode.
large resultset connection times out
Closing Statement object prior to committing