File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and Relational Databases and the fly likes How can we store the values in the DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How can we store the values in the DB" Watch "How can we store the values in the DB" New topic
Author

How can we store the values in the DB

Mastan Rao
Greenhorn

Joined: Nov 26, 2007
Posts: 10
Hi All,

How can we store the value in the Data Base with the 0's in the before the number.

Ex:I have a number in the Db with value 36 , I want that value to be stored as 00036 in the DB.Can any one help me to do that.

Thanks in Advance,

Mastan.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
Numbers don't have leading zeros, so the only option would be to store them as datatype varchar.
S J Martin
Greenhorn

Joined: Jul 31, 2007
Posts: 23
Or, ...
Store them as the value that they are and worry about rendering where it matters. ;-)


Never attribute to malice that which is easily explained by incompetence.<br />SCJP (1.5)
 
 
subject: How can we store the values in the DB
 
It's not a secret anymore!