Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Sunday, March 11, 2012

Can't retrieve second resultset with jdbc sql server 2005 driver

Hi All,

My java application executes one stored procedure that returns two resultsets and then deal with data. The code actually is very simple

Statement stmt = con.createStatement(); con is database connection

ResultSet rs = stmt.getResultSet();

//Do something

rs.close();

rs = stmt.getResultSet();

//Do something

Then I got the error: The result set is closed.

The code worked well with jdbc sql server 2000 driver.

Thanks for your help.

Eric

Hello lxiao,

The syntax for getting the second result set is

if(stmt.getMoreResults())

stmt.getResultSet();

Keep in mind that the getMoreResults() methods takes multiple arguments which controls how visited result sets should persist. Those flags are:

CLOSE_CURRENT_RESULT

CLOSE_ALL_RESULTS

You can find more information about using multiple result sets objects at the following site http://msdn2.microsoft.com/en-us/library/ms378758.aspx

Regards,

Jaaved Mohammed

Can't retrieve second resultset with jdbc sql server 2005 driver

Hi All,

My java application executes one stored procedure that returns two resultsets and then deal with data. The code actually is very simple

Statement stmt = con.createStatement(); con is database connection

ResultSet rs = stmt.getResultSet();

//Do something

rs.close();

rs = stmt.getResultSet();

//Do something

Then I got the error: The result set is closed.

The code worked well with jdbc sql server 2000 driver.

Thanks for your help.

Eric

Hello lxiao,

The syntax for getting the second result set is

if(stmt.getMoreResults())

stmt.getResultSet();

Keep in mind that the getMoreResults() methods takes multiple arguments which controls how visited result sets should persist. Those flags are:

CLOSE_CURRENT_RESULT

CLOSE_ALL_RESULTS

You can find more information about using multiple result sets objects at the following site http://msdn2.microsoft.com/en-us/library/ms378758.aspx

Regards,

Jaaved Mohammed

Friday, February 10, 2012

Can't get SP3a installed

I'm trying to get SP3a installed on my computer, and it simply will not
update. Here's what SELECT @.@.VERSION returns:
Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48
Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on Windows
NT 5.1 (Build 2600: Service Pack 2)
According to the MS web site, this is the original installation version. I
downloaded all 3 of the files at the end of the "Microsoft SQL Server 2000
Service Pack 3a" page, and followed the instructions and installed
sql2ksp3.exe first, then installed sql2kasp3.exe. I stopped the services,
and restarted the services, and SELECT @.@.VERSION still returns the same
exact thing as what is listed above. What did I do wrong here?
Thanks,
JesseHi
After running sql2ksp3.exe (it extracts to a directory), did you run the
setup.bat to install the SP?
Did the setup.bat run with errors?
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jesse" wrote:
> I'm trying to get SP3a installed on my computer, and it simply will not
> update. Here's what SELECT @.@.VERSION returns:
> Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48
> Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on Windows
> NT 5.1 (Build 2600: Service Pack 2)
> According to the MS web site, this is the original installation version. I
> downloaded all 3 of the files at the end of the "Microsoft SQL Server 2000
> Service Pack 3a" page, and followed the instructions and installed
> sql2ksp3.exe first, then installed sql2kasp3.exe. I stopped the services,
> and restarted the services, and SELECT @.@.VERSION still returns the same
> exact thing as what is listed above. What did I do wrong here?
> Thanks,
> Jesse
>
>|||No, I guess I missed the part about the setup.bat. I'm running that now.
Thanks,
Jesse
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:9ACC7775-75DD-409D-960B-1AA7507F63B5@.microsoft.com...
> Hi
> After running sql2ksp3.exe (it extracts to a directory), did you run the
> setup.bat to install the SP?
> Did the setup.bat run with errors?
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
>
> "Jesse" wrote:
>> I'm trying to get SP3a installed on my computer, and it simply will not
>> update. Here's what SELECT @.@.VERSION returns:
>> Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48
>> Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on
>> Windows
>> NT 5.1 (Build 2600: Service Pack 2)
>> According to the MS web site, this is the original installation version.
>> I
>> downloaded all 3 of the files at the end of the "Microsoft SQL Server
>> 2000
>> Service Pack 3a" page, and followed the instructions and installed
>> sql2ksp3.exe first, then installed sql2kasp3.exe. I stopped the
>> services,
>> and restarted the services, and SELECT @.@.VERSION still returns the same
>> exact thing as what is listed above. What did I do wrong here?
>> Thanks,
>> Jesse
>>|||As you found out, the running of the EXE only extracts the files to actually
run.
Have fun.
--
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jesse" <nospam@.fake.com> wrote in message
news:%231LnLWcbFHA.3464@.tk2msftngp13.phx.gbl...
> No, I guess I missed the part about the setup.bat. I'm running that now.
> Thanks,
> Jesse
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
> news:9ACC7775-75DD-409D-960B-1AA7507F63B5@.microsoft.com...
>> Hi
>> After running sql2ksp3.exe (it extracts to a directory), did you run the
>> setup.bat to install the SP?
>> Did the setup.bat run with errors?
>> Regards
>> --
>> Mike Epprecht, Microsoft SQL Server MVP
>> Zurich, Switzerland
>> MVP Program: http://www.microsoft.com/mvp
>> Blog: http://www.msmvps.com/epprecht/
>>
>> "Jesse" wrote:
>> I'm trying to get SP3a installed on my computer, and it simply will not
>> update. Here's what SELECT @.@.VERSION returns:
>> Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48
>> Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on
>> Windows
>> NT 5.1 (Build 2600: Service Pack 2)
>> According to the MS web site, this is the original installation version.
>> I
>> downloaded all 3 of the files at the end of the "Microsoft SQL Server
>> 2000
>> Service Pack 3a" page, and followed the instructions and installed
>> sql2ksp3.exe first, then installed sql2kasp3.exe. I stopped the
>> services,
>> and restarted the services, and SELECT @.@.VERSION still returns the same
>> exact thing as what is listed above. What did I do wrong here?
>> Thanks,
>> Jesse
>>
>