aspose file tools*
The moose likes JDBC and the fly likes CallableStatement - Scrollable ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "CallableStatement - Scrollable ResultSet" Watch "CallableStatement - Scrollable ResultSet" New topic
Author

CallableStatement - Scrollable ResultSet

Avneet Singh
Ranch Hand

Joined: Apr 25, 2006
Posts: 51
Hi

I wanted to knw how do we set a result set type = scrollable in callablestatements.

generally in statements or prepared statements we do

Statement stmt = oConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);

PreparedStatement stmt = oConn.prepareStatement(insert,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);

but where should we do this in a callablestatement.

CallableStatement stmt = oConn.prepareCall();

thanks.
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

refer to javadocs for Connection, it has methods for same
  • connection.prepareCall(String sql, int resultSetType, int resultSetConcurrency)
  • connection.prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)



  • Hope this helps !

    Shailesh
    [ May 09, 2006: Message edited by: Shailesh Chandra ]

    Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
    Shailesh Chandra
    Ranch Hand

    Joined: Aug 13, 2004
    Posts: 1081

    Avneet,

    out of curosity just want to ask where are you going to use this. What is your database etc...

    As far as I know about Oracle,In Oracle ResultSet scrollability is not supported on resultsets returned from a stored procedure or function

    This fact is true upto Oracle 10g release 1, I am not sure about 10 g release 2.

    Read the documents of your DB vendor, if it has support for scrollable resultsets or not.

    Shailesh
    Avneet Singh
    Ranch Hand

    Joined: Apr 25, 2006
    Posts: 51
    thanks for ur help.

    Ya you are rt it doesnt support rs scrollability returned from a stored procedure at db end.

    By the way im using Oracle 8i
     
    wood burning stoves
     
    subject: CallableStatement - Scrollable ResultSet