Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
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?
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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!
 
Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic