Pesquisei no forum e na internet como executar store procedure com jdbc e achei somente de inclusao !!!
Gostaria de saber como q eu faço pra executar uma procedure que retorno valor !!!
Eu fiz assim:
ResultSet rs = statement.execute("NomeDaProcedure " + argumento1 + “,” + argumento2) e da erro !!!
com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
at Broker.BrokerSincronizarLigacoes.getValorCusto(BrokerSincronizarLigacoes.java:267)
at Broker.BrokerSincronizarLigacoes.sincronizarLigacoes(BrokerSincronizarLigacoes.java:163)
at Model.SincronizarLigacoes.sincronizarLigacoes(SincronizarLigacoes.java:9)
at Control.CtrlSincronizarLigacoes.sincronizarLigações(CtrlSincronizarLigacoes.java:11)
at View.FormSincronizarLigacoes.sincronizarLigacoes(FormSincronizarLigacoes.java:64)
at View.FormSincronizarLigacoes.<init>(FormSincronizarLigacoes.java:47)
at View.FormDesktop.actionPerformed(FormDesktop.java:145)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Alguem sabe como q faz ?? A procedure vai me retornar um decimal(10,2) !!!
VLW