Solved

exec of stored procedure not working with Microsoft sqljdbc 2.0

Posted on 2009-07-14
5
363 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
[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
  • 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
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 video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

617 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