This is not a JSP question but rather a question on JDBC.  Books are
available from publishers Addison Wesley, O'Reilly, Prentice Hall,
etc...

Guilherme - PerConsult wrote:
> I`m trying to call a stored procedure using JSP... well, I have in my
> form a text box called "descricao", and my sp will insert the value
> written in my text box into the database.
>
> // "descricao" is the name of the text box
> String descricao2 = request.getParameter("descricao");
>
> // "InsereItem" is my stored procedure. I want to
> // insert the value that are in the text box called
> // "descricao" ...  I think that here is my mistake..
> CallableStatement cs = con.prepareCall("{call InsereItemAparencia
> "descricao2"}");

You need to use parentheses after the procedure name and put in question
mark placeholders.  The value it set using
cs.setXXXXX(placeholder_number,value) at a later point:

    CallableStatement cs = con.prepareCall("{call
InsereItemAparencia(?)}");
    cs.setString(1,descricao2);

The `1' means to replace the first question mark in the callable
statement with the given value.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to