[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2001-06-09
10
Medium Priority
?
400 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.
Suggested Courses

650 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