File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Stored procedure not being refreshed while accessing through code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Stored procedure not being refreshed while accessing through code" Watch "Stored procedure not being refreshed while accessing through code" New topic
Author

Stored procedure not being refreshed while accessing through code

Saumya Nair
Ranch Hand

Joined: Apr 25, 2006
Posts: 34
Hello all,


I m using Tomacat to run a web-application. Used stored procedure to access data from MSSQL Server. But when i re-run the application, it always calls the old stored procedure,while the result displayed in the Query Analyser is the modified one. Tried restarting the server as well as deleting the work folder and the generated class files too. But no change.

Even if i add/remove a parameter in the already created stored procedure it refuses to accept it. Gives an SQLException sayin the parameter is coded.Checked the code.. No errors with the code..

Plz help
Tom George
Ranch Hand

Joined: Jan 28, 2004
Posts: 41
Hello there,
Not sure if this thread is relevant in a JSP forum; Maybe you can try deleting and recreating the procedure, create it under a new name etc and then try to call it. Maybe check how you're connecting to the database to make sure you're going to the right table. This should not be related in any way to the fact that you're running JSP in Tomcat.

Cheers!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Moving to the JDBC forum where the database gurus hang out.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Saumya Nair
Ranch Hand

Joined: Apr 25, 2006
Posts: 34
tried deleting n recreating it too.. works fine with Query analyzer... but with code it says "could not find the stored procedure"
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

It might be that the stored procedure is attached to a specific user or defined on both a user and system level. That's the most common case I've seen for the problem you're describing.

Query Analyzer does some nice things for you and figures out users whereas direct JDBC often only has access to specific items based on the user you logged in as. Try calling the procedure with the user's name.


My Blog: Down Home Country Coding with Scott Selikoff
Saumya Nair
Ranch Hand

Joined: Apr 25, 2006
Posts: 34
Yes.. it did work.. Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stored procedure not being refreshed while accessing through code