Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JDBC and Relational Databases
Default varchar length is 255, not 256. Why ?
Pho Tek
Ranch Hand
Posts: 782
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm using openJPA with apache derby.
If I do not specify the actual width of the varchar field, it automatically
maps a
String
field to a varchar(255).
My question: why 255, and not 256 (since 256 is a power of two) ?
Tarun Yadav
Ranch Hand
Posts: 134
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm guessing since the count is 0 based. 0-255 = 256 possible values.
Bill Cruise
Ranch Hand
Posts: 148
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The length of the varchar is stored as a byte by the RDBMS. This makes the possible range of 8-bit values 0-255.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
why table field properties not follow what we set in mapping file ?
Question about the type of JoinColumn.
Create table failure
Only 256 chars stored in DB field
Dim of Array
More...