This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Error while calling stored procedure with Spring Jdbc Dao (StoredProcedure) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Error while calling stored procedure with Spring Jdbc Dao (StoredProcedure)" Watch "Error while calling stored procedure with Spring Jdbc Dao (StoredProcedure)" New topic
Author

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

prveen dhannapuneni
Greenhorn

Joined: Oct 13, 2007
Posts: 7
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.
 
wood burning stoves
 
subject: Error while calling stored procedure with Spring Jdbc Dao (StoredProcedure)
 
Similar Threads
java.sql.SQLException: Output parameters have not yet been processed. Call getMoreResults()
Can a oracle Stored procedure return a cursor as a return value?
simpleJdbcCall , org.springframework.jdbc.BadSqlGrammarException
Strange problem calling oracle function with spring
Unit testing StoredProcedure with HSQLDB