Originally posted by Bear Bibeault:
SimpleDateFormat is used to render a date for display. Are you using it to store the data in the DB as a string as opposed to an actual date?
If this your desired approach and you do not need the complete timestamp (i.e. the only thing you are using this for is to prevent duplicate monthly entries), I'd create a column to contain only the month/year and put a unique constraint on it.
[ February 14, 2005: Message edited by: Bear Bibeault ]
Yes, I am using the SimpleDataFormat to prepare the java Date for storage in the DB. Is this not correct?
I need the time as well, because I sort my ResultsSet by date & time.
I'm not sure what you mean to "put a unique constraint on it".
I only want to allow the client to add one new record per month to the database. If the record already exists in that month, then the record is just updated.
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
A timing clock, fuse wire, high explosives and a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|