Most databases offer several types to store character (String) data. The
main types are CHAR, VARCHAR and CLOB. CHAR is for fixed sized data, in
Oracle the max size is 2,000, VARCHAR is for variable sized data, in Oracle
the max size is 4,000, CLOB is for large data, in Oracle the max size is
4gig.
Check you database for its max sizes, on most databases VARCHAR has a larger
max size than 255. If you think you data may be bigger than the max size
for your database then use a CLOB. VARCHAR is more efficient than a CLOB so
only use a CLOB when you really need to.
Shelley wrote:
>
> I'm interested in strategies for persisting/mapping java.lang.String
> objects. The majority of RDBMS support VARCHAR data types with a maximum
> length of 255; however, since the length of a java.lang.String is
> unbounded, this creates a problem with ORM mappings.
>
> What strategies have been used to overcome this data type inconsistency in
> Java Persistence / ORM applications?
>
--
View this message in context: http://www.nabble.com/String-Persistence-Strategies-tf4387515.html#a12522628
Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.