Solved

exec of stored procedure not working with Microsoft sqljdbc 2.0

Posted on 2009-07-14
5
360 Views
Last Modified: 2012-06-21
I am running an SQL Server stored procedure from a jsp program. It has been running fine with Microsoft sqljdbc driver version 1.1, but today I installed version 2.0. Now when I run the SP I get:

 DROPreport.jsp: 0, The statement did not return a result set.
exec dbo._DROPinterest_sp '546370',null

The last line above beginning "exec dbo. ..." is the query.

Any ideas?
0
Comment
Question by:jmarkfoley
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:elimesika
ID: 24854217
HI

Yes, actually , this is a FEATURE added with the 1.2 release.

But, you can still get it working

See
http://blogs.msdn.com/jdbcteam/archive/2008/08/01/use-execute-and-getmoreresults-methods-for-those-pesky-complex-sql-queries.aspx
0
 
LVL 19

Expert Comment

by:elimesika
ID: 24854268
another solution I have seen suggested to call
SET NOCOUNT ON
if your SP does not return a result set

try it

Full post
http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/6bd281b0-c9d7-4987-80e7-2901b72daafe
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 24854748
elimesika - I checked out that link. You have got to be kidding me! Did someone have a contest to see how complex a jdbc query could be made? Hats off the to winner! That example is 70 lines of code instead of the less than 10 lines with the 1.1 Statement.executeQuery()

This stored procedure does return one result set, it is not empty and I do have SET NOCOUNT ON.

I have stored procedures all over this application. I can afford to go through and rewrite all my programs because of a driver change.

Is this the only possible reason this query isn't working? If so, I'll have to stick with version 1.1
0
 
LVL 19

Accepted Solution

by:
elimesika earned 500 total points
ID: 24887198
HI

Sorry to say that I don't know any other workaround for that, anyway, I am still working with the 1.1 driver in some of our applications , so, if you can stay with the 1.1 driver , its seems to me OK.
0
 
LVL 1

Author Closing Comment

by:jmarkfoley
ID: 31603475
OK, I'll stick with 1.1 for now! It seems crazy for an driver upgrade to kill existing apps. Plus, it seems nonsensical in this case where the SP returns a simple result set. I can't imagine anyone cares if an SP "partially" works or some, but not all, of the component queries work. Either it works and returns the desired result set or the programmer has more work to do to fix the query!  But hey, that's just my opinion! Thanks.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

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