>What could be the problem?
1) Don't use URLEncoder for this. Use an encoder designed for
encoding database fields, not URLEncoder which is designed for URLs.
One simple fix is use a PreparedStatement; "insert into table set
fieldName=?".
2) JSP pages shouldn't be accessing databases. This belongs in a bean.
3) See http://virtualschool.edu/jwaa for a stronger architecture for
doing this. You're doing it the way JSP encourages you to do it, and
this way is fundamentally unsound for reasons described there.
At 2:37 PM +0200 7/2/01, Gemma Montero wrote:
>Hi all,
>
>I have a jsp page with a form which has a textarea to insert data in an
>Informix varchar field .
>When I write anything in the textarea and send to de database all the
>data are correct, except it ignores the new line symbols. With the rest
>of chars it works fine.
>I dont know if i am using the correct sentences.
> When I insert the data I use:
> String queryinsertreg = "INSERT INTO table(field) VALUES('" +
>URLEncoder.encode(fieldvalue) + "')";
> To retrieve data:
> <%= URLDecoder.decode(field) %>
>
>What could be the problem?
--
---
For industrial age goods there were checks and credit cards.
For everything else there is mybank.dom at http://virtualschool.edu/mybank
Brad Cox, PhD; [EMAIL PROTECTED] 703 361 4751
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets