Board index » jbuilder » Question about method "getTimestamp" in com.borland.dx.dataset.ReadRow

Question about method "getTimestamp" in com.borland.dx.dataset.ReadRow


2004-04-14 03:12:59 AM
jbuilder1
Hi,
It seems like that if there are multiple rows in a StorageDataSet,
the method
getTimestamp(int / String)
in
com.borland.dx.dataset.ReadRow
will always return the SAME object reference to a Date object. Is this
object re-used / repopulated every time a next row is fetched and retrieved?
If that's the case, whenever there is a need to use that Date object, i.e.
set it into other object, it would be required to 'clone' the Date object
instead of using the reference itself, otherwise there would be a risk that
multiple objects using the same Date object.
Is this understanding correct? Could anyone give some clarification on this?
Thanks
John, Y
 
 

Re:Question about method "getTimestamp" in com.borland.dx.dataset.ReadRow

In <407c3bbe$ XXXX@XXXXX.COM >John Y. wrote:
Quote
Hi,
It seems like that if there are multiple rows in a StorageDataSet,
the method getTimestamp(int / String) in

com.borland.dx.dataset.ReadRow

will always return the SAME object reference to a Date object. Is this
object re-used / repopulated every time a next row is fetched and
retrieved? If that's the case, whenever there is a need to use that
Date object, i.e. set it into other object, it would be required to
'clone' the Date object instead of using the reference itself,
otherwise there would be a risk that multiple objects using the same
Date object.



Is this understanding correct? Could anyone give some clarification on
this?
Sorry I don't understand your concern.. Even if it is a resuable
object, at your end you should use it and toss it.. and NEVER pass it on,
this is just good programming. (trapping references..etc..) If you need
to pass that object to another reference you should not but instead (
example of saving date to a ArrayList
myarraylist.add(new java.sql.Date(myDate.getTime());
In this way you are not passing this reference around..
Is this what you were asking..??
John..
--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/papers.html
====================================================