Solved

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

Posted on 2001-06-09
10
389 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
[X]
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
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

730 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