File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
JDBC and Relational Databases
Default varchar length is 255, not 256. Why ?
Joined: Nov 05, 2000
Oct 21, 2007 20:50:00
I'm using openJPA with apache derby.
If I do not specify the actual width of the varchar field, it automatically
field to a varchar(255).
My question: why 255, and not 256 (since 256 is a power of two) ?
Joined: Sep 20, 2007
Oct 22, 2007 01:28:00
I'm guessing since the count is 0 based. 0-255 = 256 possible values.
Joined: Jun 01, 2007
Oct 22, 2007 06:40:00
The length of the varchar is stored as a byte by the RDBMS. This makes the possible range of 8-bit values 0-255.
I agree. Here's the link:
subject: Default varchar length is 255, not 256. Why ?
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
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015