This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes null terminated text values in the DB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "null terminated text values in the DB?" Watch "null terminated text values in the DB?" New topic
Author

null terminated text values in the DB?

Xabier Martija
Ranch Hand

Joined: Jul 18, 2007
Posts: 40
Hi,

In my assignments instructions i have read this:


but what i found in the DB is that all the text values don't end with "null" values. They end with 0x20 (blanks) values until end of value length.

I expected they sould end with 0x00 values. That's what i think a "null" value sould look like.Am i wrong?

Actually i create a StringBuffer this way and the default value for byte is 0x00:



Could someone help me?
John Stone
Ranch Hand

Joined: May 04, 2007
Posts: 332
This is common problem. Make a note in choices.txt and decide whether you will use spaces or nulls and document that decision as well.
Xabier Martija
Ranch Hand

Joined: Jul 18, 2007
Posts: 40
Thank you.
I will document it in my choices.txt.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: null terminated text values in the DB?