This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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
Marshal

Joined: Mar 22, 2005
Posts: 41017
    
  43
Numbers don't have leading zeros, so the only option would be to store them as datatype varchar.


Ping & DNS - my free Android networking tools app
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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can we store the values in the DB
 
Similar Threads
Verifying the db file
remove null
why we can't avoid hash collision in practice ?
Arraylist Size
(How do i do paging in JSP ????? HELP ME >URGENT