my dog learned polymorphism*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 2491
    
    8

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
large resultset connection times out
Closing Statement object prior to committing
Connection.close() and preparedStatement.close() in Connection.TRANSACTION_SERIALIZABLE mode.
urgent help reqd