• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Database display changes

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When updating the database the original empty spaces between fields changes to "squares" in the database display in WordPad (Not in Notepad). Does it mean anything or is it just somthing I can ignore?

I'm using


and
 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can safely ignore that. Word Pad and Word add word processing functionality whereas Notepad is a straight text editor. I suggest looking at the database file in a hex editor with an ASCII conversion chart so you will know exactly what is in there. It isn't all alpha numeric characters.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That happends because initialy, the database contains textvalues with blank spaces (0x20) trailing.
When you read the data, you normaly trim it.
When you write the data, you use:

That creates a byte[n] with n byte set to 0x00. 0X00 are not blank spaces.

_You can read this thread for more information.http://www.coderanch.com/t/189356/java-developer-SCJD/certification/null-terminated-text-values-DB
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!