diff -ru CVS/classpath/java/sql/Date.java updated/classpath/java/sql/Date.java
--- CVS/classpath/java/sql/Date.java	2010-06-27 08:54:14.000000000 +0400
+++ updated/classpath/java/sql/Date.java	2010-06-27 09:01:50.000000000 +0400
@@ -1,5 +1,6 @@
 /* Date.java -- Wrapper around java.util.Date
-   Copyright (C) 1999, 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2003, 2005, 2006, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -53,7 +54,8 @@
   /**
    * Used for parsing and formatting this date.
    */
-  private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+  private static final SimpleDateFormat sdf
+    = new SimpleDateFormat("yyyy-MM-dd");
 
   /**
    * This method initializes a new instance of this class with the
@@ -88,7 +90,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public int getHours() throws IllegalArgumentException
+  public int getHours()
   {
     throw new IllegalArgumentException();
   }
@@ -99,7 +101,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public int getMinutes() throws IllegalArgumentException
+  public int getMinutes()
   {
     throw new IllegalArgumentException();
   }
@@ -110,7 +112,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public int getSeconds() throws IllegalArgumentException
+  public int getSeconds()
   {
     throw new IllegalArgumentException();
   }
@@ -121,7 +123,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public void setHours(int newValue) throws IllegalArgumentException
+  public void setHours(int newValue)
   {
     throw new IllegalArgumentException();
   }
@@ -132,7 +134,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public void setMinutes(int newValue) throws IllegalArgumentException
+  public void setMinutes(int newValue)
   {
     throw new IllegalArgumentException();
   }
@@ -143,7 +145,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public void setSeconds(int newValue) throws IllegalArgumentException
+  public void setSeconds(int newValue)
   {
     throw new IllegalArgumentException();
   }
@@ -154,9 +156,13 @@
    *
    * @param str The string to parse.
    * @return The resulting <code>java.sql.Date</code> value.
+   * @exception IllegalArgumentException If the argument is <code>null</code>
+   * or not in the valid SQL date format (yyyy-MM-dd).
    */
   public static Date valueOf (String str)
   {
+    if (str == null)
+      throw new IllegalArgumentException();
     try
       {
         java.util.Date d = (java.util.Date) sdf.parseObject(str);
diff -ru CVS/classpath/java/sql/Time.java updated/classpath/java/sql/Time.java
--- CVS/classpath/java/sql/Time.java	2010-06-27 08:54:26.000000000 +0400
+++ updated/classpath/java/sql/Time.java	2010-06-27 09:02:40.000000000 +0400
@@ -1,5 +1,5 @@
 /* Time.java -- Wrapper around java.util.Date
-   Copyright (C) 1999, 2000, 2002, 2003, 2005, 2006
+   Copyright (C) 1999, 2000, 2002, 2003, 2005, 2006, 2010
    Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
@@ -55,7 +55,8 @@
   /**
    * Used for parsing and formatting this date.
    */
-  private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
+  private static final SimpleDateFormat sdf
+    = new SimpleDateFormat("HH:mm:ss");
 
   /**
    * This method always throws an IllegalArgumentException.
@@ -63,7 +64,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public int getDate() throws IllegalArgumentException
+  public int getDate()
   {
     throw new IllegalArgumentException();
   }
@@ -74,7 +75,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public int getDay() throws IllegalArgumentException
+  public int getDay()
   {
     throw new IllegalArgumentException();
   }
@@ -85,7 +86,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public int getMonth() throws IllegalArgumentException
+  public int getMonth()
   {
     throw new IllegalArgumentException();
   }
@@ -96,7 +97,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public int getYear() throws IllegalArgumentException
+  public int getYear()
   {
     throw new IllegalArgumentException();
   }
@@ -107,7 +108,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public void setDate(int newValue) throws IllegalArgumentException
+  public void setDate(int newValue)
   {
     throw new IllegalArgumentException();
   }
@@ -118,7 +119,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public void setMonth(int newValue) throws IllegalArgumentException
+  public void setMonth(int newValue)
   {
     throw new IllegalArgumentException();
   }
@@ -129,7 +130,7 @@
    * @throws IllegalArgumentException when it's called.
    * @deprecated
    */
-  public void setYear(int newValue) throws IllegalArgumentException
+  public void setYear(int newValue)
   {
     throw new IllegalArgumentException();
   }
@@ -140,9 +141,13 @@
    *
    * @param str The string to parse.
    * @return The resulting <code>java.sql.Time</code> value.
+   * @exception IllegalArgumentException If the argument is <code>null</code>
+   * or not in the valid SQL time format (HH:mm:ss).
    */
   public static Time valueOf (String str)
   {
+    if (str == null)
+      throw new IllegalArgumentException();
     try
       {
         java.util.Date d = (java.util.Date) sdf.parseObject(str);
@@ -169,11 +174,7 @@
     */
   public Time(int hour, int minute, int second)
   {
-    super(System.currentTimeMillis());
-
-    setHours(hour);
-    setMinutes(minute);
-    setSeconds(second);
+    super(1970 - 1900, 0, 1, hour, minute, second);
   }
 
   /**
diff -ru CVS/classpath/java/sql/Timestamp.java updated/classpath/java/sql/Timestamp.java
--- CVS/classpath/java/sql/Timestamp.java	2010-06-27 08:54:42.000000000 +0400
+++ updated/classpath/java/sql/Timestamp.java	2010-06-27 09:07:12.000000000 +0400
@@ -1,5 +1,6 @@
 /* Time.java -- Wrapper around java.util.Date
-   Copyright (C) 1999, 2000, 2003, 2004, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2003, 2004, 2006, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -59,10 +60,8 @@
   /**
    * Used for parsing and formatting this date.
    */
-  private static SimpleDateFormat dateFormat =
+  private static final SimpleDateFormat dateFormat =
     new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-  private static DecimalFormat decimalFormat = new DecimalFormat("000000000");
-  private static StringBuffer sbuf = new StringBuffer(29);
 
   /**
     * The nanosecond value for this object
@@ -75,9 +74,13 @@
    *
    * @param str The string to parse.
    * @return The resulting <code>java.sql.Timestamp</code> value.
+   * @exception IllegalArgumentException If the argument is <code>null</code>
+   * or not in the valid SQL timestamp format
    */
   public static Timestamp valueOf(String str)
   {
+    if (str == null)
+      throw new IllegalArgumentException();
     int nanos = 0;
     int dot = str.indexOf('.');
     if (dot != -1)
@@ -86,7 +89,9 @@
           throw new IllegalArgumentException(str);
 
         int len = str.length() - dot - 1;
-        if (len < 1 || len > 9)
+        char ch;
+        if (len < 1 || len > 9 ||
+            (ch = str.charAt(dot + 1)) == '-' || ch == '+')
           throw new IllegalArgumentException(str);
 
         nanos = Integer.parseInt(str.substring(dot + 1));
@@ -129,12 +134,16 @@
    * @param minute The minute for this Timestamp (0-59)
    * @param second The second for this Timestamp (0-59)
    * @param nanos The nanosecond value for this Timestamp (0 to 999,999,9999)
+   * @exception IllegalArgumentException If <code>nanos</code> is outside
+   * 0 .. 999999999
    * @deprecated
    */
   public Timestamp(int year, int month, int day, int hour, int minute,
     int second, int nanos)
   {
     super(year, month, day, hour, minute, second);
+    if (nanos > 999999999 || nanos < 0)
+      throw new IllegalArgumentException("nanos > 999999999 or < 0");
     this.nanos = nanos;
   }
 
@@ -143,12 +152,29 @@
    * specified time value representing the number of milliseconds since
    * Jan 1, 1970 at 12:00 midnight GMT.
    *
-   * @param date The time value to intialize this <code>Time</code> to.
+   * @param time The time value to intialize this <code>Time</code> to.
    */
-  public Timestamp(long date)
+  public Timestamp(long time)
   {
-    super(date - (date % 1000));
-    nanos = (int) (date % 1000) * 1000000;
+    super((time / 1000) * 1000);
+    nanos = (int) (time % 1000) * 1000000;
+    if (nanos < 0)
+      {
+        nanos = 1000000000 + nanos;
+        super.setTime((time / 1000 - 1) * 1000);
+      }
+  }
+
+  public void setTime(long time)
+  {
+    nanos = (int) (time % 1000) * 1000000;
+    if (nanos < 0)
+      {
+        nanos = 1000000000 + nanos;
+        super.setTime((time / 1000 - 1) * 1000);
+      }
+    else
+      super.setTime((time / 1000) * 1000);
   }
 
   /**
@@ -167,17 +193,18 @@
    */
   public String toString()
   {
+    String nanoStr = Integer.toString(nanos);
+    int end = nanoStr.length() - 1;
+    while (nanoStr.charAt(end) == '0')
+      if (--end < 0)
+        break;
+    String timeStr;
     synchronized (dateFormat)
       {
-        sbuf.setLength(0);
-        dateFormat.format(this, sbuf, null);
-        sbuf.append('.');
-        decimalFormat.format(nanos, sbuf, null);
-        int end = sbuf.length() - 1;
-        while (end > 20 && sbuf.charAt(end) == '0')
-          end--;
-        return sbuf.substring(0, end + 1);
+        timeStr = dateFormat.format(this);
       }
+    return timeStr + ".00000000".substring(0, end >= 0 ? 9 - end : 2) +
+             nanoStr.substring(0, end + 1);
   }
 
   /**
@@ -193,9 +220,13 @@
    * This method sets the nanosecond value for this object.
    *
    * @param nanos The nanosecond value for this object.
+   * @exception IllegalArgumentException If the argument is outside
+   * 0 .. 999999999
    */
   public void setNanos(int nanos)
   {
+    if (nanos > 999999999 || nanos < 0)
+      throw new IllegalArgumentException("nanos > 999999999 or < 0");
     this.nanos = nanos;
   }
 
