File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Data Type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Data Type" Watch "Data Type" New topic
Author

Data Type

ramandeep singh
Greenhorn

Joined: Jun 27, 2001
Posts: 20
Hi I have a very basic doubt about FBN
All the data is stored as STRINGS
Where should we convert the data into appropriate type
For example we need to convert "Avail Seats" to Integer.
And where should be this mapping.
Is it OK to modify data info class
Thanks


Ramandeep Singh
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 2547
You can parse the avail. seats string to an integer when you need to process it. For ex. while validating a booking request (no of seats required should be less than no of seats available) or while updating the database after reducing the no. of available seats.
For displaying etc. you can simply use it as a string.
You can say that this is a limitation of your database that you can only store strings. You can but you don't need to modify the Data class for this.
-Paul.
------------------
Get Certified, Guaranteed!
www.enthuware.com/jqplus

SCJP2 Resources, WebCompiler, Compare Mock Exam Results and More!
www.jdiscuss.com
Your guide to SCJD exam!
www.enthuware.com/jdevplus


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
Rick Fortier
Ranch Hand

Joined: Jun 04, 2001
Posts: 147
I would not modify DataInfo either.
ramandeep singh
Greenhorn

Joined: Jun 27, 2001
Posts: 20
Thx Paul
Yeah I can convert the fields for claculation.
But in that case I have to hardcode the conversion
on client side.
But I think it is okay for this application.
Any Comments?
 
 
subject: Data Type
 
Threads others viewed
how we convert long into float
widening conversion problem(Ref RHE)
Returning the different type from the Servlet Filter
Is my Data class design Okay?
varchar2, clob and blob?
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com