Solved

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

Posted on 2001-06-09
10
380 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now