| Author |
Cookbook Question: comparing sql.Date/Time
|
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4115
|
|
All right, so this may not be a question directly related to the book but maybe someone knows a good OO recipe for the following problem: My object persists it's data in several db tables. Each of these tables has change user, change date, and change time information kept in separate fields. The problem is, when I retrieve the data for display, I have to display only one set of the change information fields, i.e. the most recent one made. Since the number of tables that the data is being stored may change over time, I would like to make the test for which change is the most recent. What is the best way to do this with java.sql.Date and java.sql.Time? Thanks in advance, Junilu
|
Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
|
 |
Peter Tran
Bartender
Joined: Jan 02, 2001
Posts: 783
|
|
Junilu, You can create a class instance variable to hold the most recent date. E.g. NOTE: This is totally a hacked up example. In no way does this example compile, but I hope you get the idea. -Peter
|
 |
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4115
|
|
|
I knew there was a simpler solution than what I had started to formulate yesterday. Just one of those days, I guess. Thanks a bunch!
|
 |
 |
|
|
subject: Cookbook Question: comparing sql.Date/Time
|
|
|