The easiest, and most portable, way to do this is using a PreparedStatement
and the setDate method. This takes a regular Date object and it's the JDBC
Drivers job to put it into the proper format for the particular database.
(*Chris*)
----- Original Message -----
From: Tom John <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 04, 1999 1: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);
> 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)
>
> (3)if the user/client enters the date value thruogh a HTML form
> how can store that value to this Database
>
>
> Should I move to ORACLE for this task to be done.
>
>
> thnaks in Advance
>
> Tom
>
>
___________________________________________________________________________
> 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