David,
Dates are very difficult to handle in Java, compared to other
languages/development environments, in my opinion. Having said that, have
you looked into some of the free shareware tag libraries out on the net?
The Jakarta project has some, Orion has some also. I don't know if the tag
libraries will help you, but if you can find one that takes a date value
typed into a "html input box", parses it for you to extract the day, month,
year, your halfway there. The timestamp I would think you would get from
the server (ie the time the user updated the db), and just insert that into
your query for updating the db. Also, if you are just wanting to get
"todays" date off the server, and parse that into a day, time, year value to
insert into your database or to display, let me know. I have some server
side code that does just that.
Don't know if this helps, but check out the date/time tag library with the
Jakarta project and see if that can help you out.
Celeste
-----Original Message-----
From: Rice, David [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 16, 2001 5:34 PM
To: [EMAIL PROTECTED]
Subject: Re: Using DATE and CALENDAR objects...
Chris,
Unfortunately, I do have to parse dates to extract needed information. The
app I'm building is a log analysis tool that expects not only the complete
timestamp, but also needs the day_of_week, day_of_month, et cetera, broken
out. We take that information, along with other environment variables to
compile access/usage reports for the higher ups. And I have to use
PreparedStatements due to the fact that I'm doing joined-table inserts. I
just haven't figured out how to incorporate the DATE/CALENDAR stuff into
them yet... ;)
I've been through the docs at:
http://java.sun.com/products/jdk/1.2/docs/api/ but they're more confusing
than anything and provide no examples that I can decipher at this point. I
also went to the tutorial suggested by Geert as well but that is much more
convoluted than what I'll need, I'm thinking.
Nonetheless, I appreciate all the feedback and help!
David
--------------------------
-----Original Message-----
From: Chris Pratt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 16, 2001 5:16 PM
To: [EMAIL PROTECTED]
Subject: Re: Using DATE and CALENDAR objects...
The best way is to use PreparedStatement's and the
setDate/setTime/setTimestamp methods. Then you don't have to parse the
dates at all.
(*Chris*)
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets