• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Error while calling stored procedure with Spring Jdbc Dao (StoredProcedure)

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Spring StoredProcedure class to call sybase stored procedure. But i am getting below error.

Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{call sts_config..FindScriptBySource(?, ?, ?, ?, ?)}]; SQL state [HY010]; error code [0]; Output parameters have not yet been processed. Call getMoreResults().; nested exception is java.sql.SQLException: Output parameters have not yet been processed. Call getMoreResults().
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:952)
at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:985)
at org.springframework.jdbc.object.StoredProcedure.execute(StoredProcedure.java:117)
at com.spring.jdbcexample.StoredProcedureDao.executeFor(StoredProcedureDao.java:25)
at com.spring.jdbcexample.JDBCMain.main(JDBCMain.java:34)
Caused by: java.sql.SQLException: Output parameters have not yet been processed. Call getMoreResults().
at net.sourceforge.jtds.jdbc.ParamInfo.getOutValue(ParamInfo.java:159)


Here is my Code:

public class StoredProcedureDao extends StoredProcedure{
public StoredProcedureDao(JdbcTemplate template){
super(template, "sts_config..FindScriptBySource");
declareParameter(new SqlParameter("sourceCode", Types.VARCHAR));
declareParameter(new SqlOutParameter("sourceCd", Types.VARCHAR));
declareParameter(new SqlOutParameter("scriptCd", Types.VARCHAR));
declareParameter(new SqlOutParameter("exprDate", Types.DATE));
declareParameter(new SqlOutParameter("scriptText", Types.VARCHAR));
compile();
}
public String executeFor(String sourceCode){
Map input=new HashMap();
input.put("sourceCode", sourceCode);
Map output=execute(input);
StringBuffer obj=new StringBuffer();
obj.append((String)output.get("sourceCd"));
obj.append((String)output.get("scriptCd"));
obj.append((String)output.get("exprDate"));
obj.append((String)output.get("scriptText"));

return obj.toString();
}
}

Please any one help me, why i am getting this error?

Thanks
Pavan.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic