I'm trying to run a Stored Procedure that returns an Integer in MS SQL Server 2014.
@SqlCall(":id = exec Create_Client " +
" @source = :c.source," +
" @manager_user_id = :c.source," +
" @status_id = :status," +
" @name = :c.name")
@OutParameter(name="id", sqlType = Types.INTEGER)
OutParameters spCreateClient(@BindBean("c") Client newClient,
@Bind("status") int status);ERROR [2016-10-05 01:02:07,232] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: 03a6bcc932db8c37
! java.sql.SQLException: Output parameters have not yet been processed. Call getMoreResults().
! at net.sourceforge.jtds.jdbc.ParamInfo.getOutValue(ParamInfo.java:159)
! at net.sourceforge.jtds.jdbc.JtdsCallableStatement.getOutputValue(JtdsCallableStatement.java:124)
! at net.sourceforge.jtds.jdbc.JtdsCallableStatement.getInt(JtdsCallableStatement.java:250)
! at org.skife.jdbi.v2.Call$OutParamArgument.map(Call.java:149)
! at org.skife.jdbi.v2.Call$1.munge(Call.java:94)
! at org.skife.jdbi.v2.Call$1.munge(Call.java:88)
! at org.skife.jdbi.v2.SQLStatement.internalExecute(SQLStatement.java:1344)
! ... 71 common frames omitted
! Causing: org.skife.jdbi.v2.exceptions.ResultSetException: Exception thrown while attempting to traverse the result set [statement:":id = exec Create_Client @source = :c.source, @manager_user_id = :c.source, @status_id = :status, @name = :c.name", located:":id = exec Create_Client @source = :c.source, @manager_user_id = :c.source, @status_id = :status, @name = :c.name", rewritten:"/* ClientDAO.spCreateClient */ ? = exec Create_Client @source = ?, @manager_user_id = ?, @status_id = ?, @name = ?", arguments:{ positional:{}, named:{c.class:class com.company.v2.core.clients.Client,c.hashId:'null',c.source:1,id:org.skife.jdbi.v2.Call$OutParamArgument@160be7af,c.id:null,c.name:'Leo-Testing-sp#7',c.status:TESTING,status:2}, finder:[]}] ! at org.skife.jdbi.v2.SQLStatement.internalExecute(SQLStatement.java:1352)
! at org.skife.jdbi.v2.Call.invoke(Call.java:88)
! at org.skife.jdbi.v2.sqlobject.CallHandler.invoke(CallHandler.java:56)
! at org.skife.jdbi.v2.sqlobject.SqlObject.invoke(SqlObject.java:212)
! at org.skife.jdbi.v2.sqlobject.SqlObject$2.intercept(SqlObject.java:109)
! at org.skife.jdbi.v2.sqlobject.CloseInternalDoNotUseThisClass$$EnhancerByCGLIB$$6bf36f34.spCreateClient(<generated>)