Solved

exec of stored procedure not working with Microsoft sqljdbc 2.0

Posted on 2009-07-14
5
357 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now