Subject RE: [Firebird-Java] SP with returning value error
Author Rick DeBay
If you're only getting back one result instead of multiple results, I'd
recommend using a CallableStatement. Retrieving a ResultSet instead of
out parameters requires the SUSPEND command in the stored procedure,
which means (AFAIK) that the SP won't finish and the driver won't commit
until the ResultSet is closed, either explicitly or implicitly.

-----Original Message-----
From: Francisco Antonio Vieira Souza
Sent: Tuesday, August 10, 2004 1:33 PM
Subject: Re: [Firebird-Java] SP with returning value error

Rick DeBay wrote:

> You left out the FROM keyword.
> And you may need to use a CallableStatement instead of
> PreparedStatement. I'm not to clear on that part, and would like
> clarification myself.

Thank you for the answer, yes you were write, I had left out something
importante, how it is working, it is not necessary to use the
CallableStatement, have a look:
PreparedStatement p = c.prepareStatement("SELECT * FROM
p.setString(1, tipo_recebimento);
p.setString(2, id_tomador);
p.setString(3, documento_origem);
p.setBigDecimal(5, perc_desconto);
p.setBigDecimal(6, perc_juros);
p.setBigDecimal(7, valor_desconto);
p.setBigDecimal(8, valor_receber);
p.setBigDecimal(9, valor_total);
p.setDate(12, data_vencimento);
p.setString(13, descricao);
p.setString(14, boleto);
ResultSet rs = p.executeQuery();
numero_gerado = rs.getInt("DOCUMENTO_GERADO");
} rs.close();

Yahoo! Groups Links