?
Solved

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

Posted on 2001-06-09
10
Medium Priority
?
395 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
Technology Partners: 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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 This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

777 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