Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

JDBC  Returning a Srollable ResultSet From a MS SQL Server Stored Procedure

Posted on 2001-06-09
10
387 Views
Last Modified: 2012-05-04
I am trying to get a scrollable resultset set running on a SQL Server 7 database. I have tried specifying
TYPE_SCOLL_SENSITIVE it doesnt work...

Procedure something like
CREATE PROCEDURE foo
AS
BEGIN  
Select * FROM bar
END

prepareCall("{call foo}",    ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)

that doesnt work


0
Comment
Question by:balugaa
10 Comments
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 6170984
What drivers are you using? Are they JDBC 2.0 compliant? Can you elaborate on the "it doesn't work"? Does that mean the ResultSet just isn't scrollable or do you get some kind of exception?

Jim
0
 

Author Comment

by:balugaa
ID: 6171581



I am using the "sun.jdbc.odbc.JdbcOdbcDriver" which I believe is version 2 compliant

The thing is if I execute a Query using the scrollable option it works, ie. I get back a scrollable result set but

when I call the procedure and try something like

rs.first(); It throws an exception

exception saying

recordset is FORWARD_ONLY



0
 

Author Comment

by:balugaa
ID: 6171650



I am using the "sun.jdbc.odbc.JdbcOdbcDriver" which I believe is version 2 compliant

The thing is if I execute a Query using the scrollable option it works, ie. I get back a scrollable result set but

when I call the procedure and try something like

rs.first(); It throws an exception

exception saying

recordset is FORWARD_ONLY



0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 3

Expert Comment

by:shyamkumarreddy
ID: 6172714
Listening
0
 

Expert Comment

by:HuangJo
ID: 6184497
hi,

I think u will be unable to set the result set to be scrollable, as indeed it is allowed to be in one direction only - forward.

Also u only can access the record in the result set one at a time.

May I know why do u need a scrollable result set? As if it is only for display purpose, u may retrieved all records or selected set of records from the database, and display them using scrollable table. Just a suggestion.

regards Jo
0
 

Author Comment

by:balugaa
ID: 6192441
The resultset forms the basis of an Abstract Table Model
Tried caching the records memory usage too high

However Came across CachedRowSet and it Did the trick

cheers all for the answer
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 7113781
what do you mean by CachedRowSet?  Can you show us what you did to make this work?
0
 

Expert Comment

by:CleanupPing
ID: 9062070
balugaa:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9120097
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[PAQ'ed/points not refunded]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 9403430
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question