Hi,

----- Original Message -----
From: Tom John <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 04, 1999 11:38 AM
Subject: DATE Problem!!!!!!!!!!!


> Hi
> In my servlet I have to save a aparticular Date value to the table called
> day_table the problem
> is the table is created usinf MicroSoft Access 97, the Table has a field
of
> date type(infact the data type is Date/Time and Format is Short Date eg
>  6/19/94)
>
> The Table has four fields.
> file://---------------------------
> ...
> ....
> ..
> ..
> Date date=new Date(1999,4,2);
<snipet from jdk1.1.6 doc>
 public Date(int year,
             int month,
             int day)
 Construct a Date Parameters:
 year - year-1900
month - 0 to 11
day - 1 to 31
</snipet>
<nosnipet >
     i don't know for newer versions of jdk like 1.2 or 1.3)
</nosnipet>


  You could use a GregorianCalendar instead

> stmt2.executeUpdate("insert into day_table values (date,'Monday',4,5)");
> ....
> ..
> file://This code gives Errors-------------------------
>
>
>
> I do have two main Questions
>
> (1) How can I store the Date value to the table as above Which was not
> successful it gives Errors
>
> (2)How can I store Year 2000 in Access . That is after instantiating as
>       Date mydate=new Date(2000,4,5)

I have faced the same problem and i have decided to strore the date as a
simple
string. You can try  Long date if you want to.


>
> (3)if the user/client enters the date value thruogh a HTML form
>     how can store that value to this Database

It is best to not do and endless verifying  upon a text field,
use instead 3 comboxes like: year, month, day.
(This should be verified too for invalid dates at client side or server
side)







>
>
> Should I move to ORACLE for this task to be done.

If you can, of course :)


>
>
> thnaks in Advance
>
> Tom


Best wishes,
            Andras

>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to