This doesn't really answer your question, but whenever I deal with 
dates I convert them to Unix and store them in the database, and then 
convert them back when I use them.  Sorting dates doesn't seem to 
work as well in a non-unix format, and with UNIX dates you have much 
more control over the way the date is printed out. So you could just 
print the month if you wanted, or print the date in a different 
format.  It gives a lot of flexibility.  That might be something for 
you to think about.  I'm not sure how you do that in jsp, but it's 
probably pretty easy.

As for your problem, I use php and not jsp, so I can't help...sorry.

John

>  Hi ,
>
>  I have a servlet in which I connect through a mysql driver to the
>database. The servlet has a string that represents the date in the
>format 'MM/DD/YY'.
>
>  When I am trying to insert this date, I get sometimes the correct date,
>sometimes I get the '0000-00-00'.
>
>Here is the code:
>  String sql_1 =  "INSERT INTO bookmgr.copy (bookid, emp_purchaser,
>date_expensed, emp_holder) VALUES (?,?,?,?)";
>  ps = myConnection.prepareStatement(sql_1);
>                       // inserting records
>                       ps.setInt(1, bookid);
>                       ps.setInt(2, userId);
>                       ps.setString(3, expensed_date);
>                       ps.setInt(4, userId);
>                       ps.executeUpdate();
>
>  I understand that this particular date '0000-00-00' comes up when you
>have an invalid date. But I am checking that I get the correct date in
>the servlet from the jsp (which comes from  a calendar)  and again,
>sometimes it works, sometimes it doesn't.
>
>  Thanks for any help,
>  Catalina
>
>---------------------------------------------------------------------
>Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail 
><[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-- 

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to