learn java
The moose likes Spring and the fly likes stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "stored procedure" Watch "stored procedure" New topic

stored procedure

Ganeshkumar cheekati
Ranch Hand

Joined: Oct 13, 2008
Posts: 362
Hi friends,

can anyone help me on these, i am trying to calling a stored procedure, it should be the resultset in the form of Map object. For these i used spring jdbc concept but i am getting a error like BadSqlGrammerException.

dao classes method.

public Map getClassificationView(String sUser,String sLocation,String sPattern, String sCurrPage){
LOG.info(">>>>>>>>>>>METHOD NAME getClassificationView Starts in Classification DAO>>>>>>>>>>>>>");
ProcedureAndFunctions stproc = new ProcedureAndFunctions();

stproc.declareParameter(new SqlOutParameter(sLocation,Types.VARCHAR));
stproc.declareParameter(new SqlOutParameter("null", Types.VARCHAR));
stproc.declareParameter(new SqlOutParameter(sCurrPage, Types.INTEGER));
stproc.declareParameter(new SqlOutParameter("Y", Types.VARCHAR));
Map results = stproc.execute();
for (Iterator it = results.keySet().iterator(); it.hasNext();)

LOG.info(">>>>>>>>>>>METHOD NAME getClassificationView Ends in Classification DAO>>>>>>>>>>>>>");
return results;


public class ProcedureAndFunctions extends StoredProcedure
public ProcedureAndFunctions()

public Map execute()

Map inputs = new HashMap<String,Object>();
return super.execute(inputs);



and my stored procedure contain four IN parameters, can help me any on these, tell me this is better one for converting the resultset into Map object or any other alternative in spring.

SCJP5 and SCWCD1.5
Think Twice Act Wise...
Bill Gorder

Joined: Mar 07, 2010
Posts: 1681

Please edit your post and UseCodeTags.

I did not look to closely at your code (formatting it with code tags would help) but the best reference in this case is the reference documentation they have pretty good example code there.

See the following:

[How To Ask Questions][Read before you PM me]
Julia Young

Joined: Jul 23, 2010
Posts: 1
Crossposted here http://forums.devshed.com/java-help-9/stored-procedure-in-spring-jdbc-926307.html#post2810447
Have you tried LearnNowOnline? http://www.learnnowonline.com/
subject: stored procedure