Which is best data type for phone number in MySQL and what should Java type mapping for it be? -
Which is best data type for phone number in MySQL and what should Java type mapping for it be? -
i using mysql spring jdbc tamplate web application. need store phone number digits (10). little bit confused info type using info type.
what preferable info type in mysql? what should java info type in bean (pojo) classes that? how can validate datatype javax validations/constrains length , digit allowed?
strings & varchar.
do not seek storing phone numbers actual numbers. ruin formatting, remove preceding 0
s , other undesirable things.
you may restrict input numeric values if take maintain persisted info characters.
be aware of wider world , how number lengths , formatting may differ before seek implement sort of length restrictions, validation or mask (xxx-xxxx-xx).
java mysql phone-number digit
Comments
Post a Comment