1 Reply Latest reply on Dec 19, 2006 8:07 PM by 807607

    Converting java.util.date to sql.date

      I am trying to insert a date into a database using a prepared statement but when i do so with
      but I get an error because it isn't a java.sql.date

      When trying to convert using
      java.sql.Date sqlRegTime = new java.sql.Date(contact.getDob());
      I get an error saying that it cannot find symbol,

      symbol : constructor Date(java.util.Date)
      location: class java.sql.Date
      java.sql.Date sqlRegTime = new java.sql.Date(patient.getDob());

      I don't full understand the syntax of converting from util.date to sql.date so probably where my issue is.