Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

idea to add trim() to getRecord() function is OK?

 
Roman Rytov
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Undoubtedly we have to trim strnigs gotten from the database but the question is WHEN. I guess to change Data class's function getRecord() is ok so instead of
rv[i] = new String(buffer, offset, description[i].getLength());
it'll be
rv[i] = new String(buffer, offset, description[i].getLength()).trim();
any drawback of such an approach?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have mine in the readRecord method, not the getRecord method. But really the exact same code as you just wrote.
Are you sure the code you entered isn't from the readRecord method?
And yes it is quite OK
Mark
[ January 07, 2002: Message edited by: Mark Spritzler ]
 
Roman Rytov
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops:-)
you're right, it's from readRecord()
sorry and thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic