Oi Daniel.
Existem objetos espec�ficos para isso na API java.sql.
Voce deve usar a interface CallableStatement para isso, de forma semelhante ao que
voce faz quando usa Statement, j� que � uma subclasse de PreparedStatement que por sua
vez herda de
Statement.
Veja o que diz o JavaDoc sobre esta API.
Interface CallableStatement
public interface CallableStatement
extends PreparedStatement
The interface used to execute SQL stored procedures. JDBC provides a stored procedure
SQL escape
that allows stored procedures to be called in a standard way for all RDBMSs. This
escape syntax has
one form that includes a result parameter and one that does not. If used, the result
parameter must be
registered as an OUT parameter. The other parameters can be used for input, output or
both. Parameters
are referred to sequentially, by number. The first parameter is 1.
{?= call <procedure-name>[<arg1>,<arg2>, ...]}
{call <procedure-name>[<arg1>,<arg2>, ...]}
IN parameter values are set using the set methods inherited from PreparedStatement.
The type of all
OUT parameters must be registered prior to executing the stored procedure; their
values are retrieved
after execution via the get methods provided here.
A CallableStatement can return one ResultSet or multiple ResultSet objets. Multiple
ResultSet objects are handled using operations inherited from Statement.
For maximum portability, a call's ResultSet objects and update counts should be
processed prior to
getting the values of output parameters.
See Also:
Connection.prepareCall(java.lang.String), ResultSet
Espero ter lhe ajudado.
[]'s
Handerson F. Gomes
dlmv wrote:
> Oi Pessoal !
>
> Gostaria de saber como posso disparar uma stored
> procedure (SQL) em Java, pode ser igual a uma consulta
> SQL ??
>
> Obrigado
> Daniel
>
> _________________________________________________________________________
> BRASIL ONLINE
> Todo brasileiro tem direito a um e-mail gr�tis - http://www.bol.com.br
>
> * Para nao receber mais e-mails da lista, acesse
><http://www.sun.com.br:8080/guest/RemoteAvailableLists>, coloque seu e-mail, escolha
>a lista <[EMAIL PROTECTED]> e de um <submit>.
* Para nao receber mais e-mails da lista, acesse
<http://www.sun.com.br:8080/guest/RemoteAvailableLists>, coloque seu e-mail, escolha a
lista <[EMAIL PROTECTED]> e de um <submit>.