Two Laptop Bag
The moose likes JDBC and the fly likes what does the following error mean Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "what does the following error mean" Watch "what does the following error mean" New topic
Author

what does the following error mean

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
I get the following error when I get to myRs.next() in my code. can someone please explain why?
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Unexpected token type: COLINFO
CallableStatement cs = myCon.prepareCall("{call notificationProcedure (?,?,?)}");
cs.setInt(1, 11);
cs.setInt(2, 20);
cs.setString(3, "jm");
boolean success = cs.execute();
while(success)
{
myRs = cs.getResultSet();
while(myRs.next())
and my stored procedure is
CREATE PROCEDURE dbo.notificationProcedure @start int, @end int, @username varchar(255)
AS
DECLARE notification_cursor SCROLL CURSOR FOR
SELECT * FROM notification
WHERE username = @username
OPEN notification_cursor
-- Perform the first fetch.
FETCH ABSOLUTE @start FROM notification_cursor
DECLARE @count int
SET @count = @start
-- Check @@FETCH_STATUS to see if there are any more rows to fetch.
WHILE @@FETCH_STATUS = 0 AND @count <= @end
BEGIN
-- This is executed as long as the previous fetch succeeds.
FETCH NEXT FROM notification_cursor
set @count = @count + 1
END
CLOSE notification_cursor
DEALLOCATE notification_cursor
GO
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: what does the following error mean
 
Similar Threads
callable statement question with sybase
obtaining one result set at a time from multiple select
best practice for a sql script for pagination
Calling oracle pl/sql procedure that has an in out ref cursor parameter
mysql cursor in stored procedure