File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using Strings to query database??

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple question. Do I have to trim() the strings before using it in a select statement?
for example:
String thisString = request.getParameter("some");
thisString = thisString.trim();
.
.
.
or is it irrelevant??
 
Graham Thorpe
Ranch Hand
Posts: 265
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes we can do trim function before select
statement.This is very useful code also why because of not all database are not supported to trim function proprty.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic