Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using Strings to query database??  RSS feed

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • 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
  • 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
Boost this thread!