Hi, Could you tell me about your TABLE-definition and version number of your JDBC Driver? I will check that problem.
"Stancescu, Catalina" wrote: > > 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(); -- TAKAHASHI, Tomohiro --------------------------------------------------------------------- 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