This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

CallableStatement - Scrollable ResultSet

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
     
    Shailesh Chandra
    Ranch Hand
    Posts: 1087
    Oracle Spring Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Posts: 51
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic