Are you doing this

String string1 = somevariable;
String string2 = someothervariable;

string1.trim();
string2.trim();

and then using string1 and string2 in the prepared statement?

Walt



-----Original Message-----
From: Neal Cabage [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 25, 2000 8:13 AM
To: [EMAIL PROTECTED]
Subject: Values not trimming - writing to DB


I am setting values into my dB (SQL server) and using a prepared statement
to do so.  I simply put in the values from my form and that should be that.
The values (once in the dB) however have a ton of empty spaces at the end of
the values however, up to the full length of the dB field.

Here's the source of my confusion:
1. The dataTypes in SQLServer are set to VarChar, not char.
2. I am using the .trim() method on each string prior to setting it in the
prepared statement
3. I just rolled the code that does the dB insert into a bean - but the
identical code within my JSP didn't give me thatproblem.

Does anyone why this would be or how I could get around it?


Thanks.
Neal

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
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

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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

Reply via email to