About 443,000 results
Open links in new tab
  1. Get the current date in java.sql.Date format - Stack Overflow

    Aug 15, 2013 · A java.util.Date is not a java.sql.Date. It's the other way around. A java.sql.Date is a java.util.Date. You'll need to convert it to a java.sql.Date by using the constructor that takes …

  2. How do I initialize a java.sql.Date variable? - Stack Overflow

    Feb 4, 2015 · java.sql.Date sqlDate = new java.sql.Date(2020,12,12); I do not know why this is deprecated, but it is very intuitive for me. basically year, month, day integer. Update: 10 …

  3. How to convert java.util.Date to java.sql.Date? - Stack Overflow

    Aug 20, 2016 · To convert, use new methods added to the old date-time classes. We can call java.sql.Date.valueOf(…) to convert a LocalDate. java.sql.Date sqlDate = …

  4. java.util.Date vs java.sql.Date - Stack Overflow

    Feb 21, 2010 · java.sql.Date extends java.util.Date class which represents date without time information and it should be used only when dealing with databases. To conform with the …

  5. java sql date time - Stack Overflow

    Feb 7, 2007 · The java.sql.Date class inherits from java.util.Date which is a date-with-time type. The java.sql.Date class pretends to be a date-only value, but actually has its time-of-day set to …

  6. mysql - A datetime equivalent in java.sql ? (is there a java.sql ...

    Jul 21, 2011 · The java.sql package has three date/time types: java.sql.Date - A date only (no time part) java.sql.Time - A time only (no date part) java.sql.Timestamp - Both date and time; …

  7. Converting java.sql.Date to java.util.Date - Stack Overflow

    Mar 1, 2015 · The class java.sql.Date is designed to carry only a date without time, so the conversion result you see is correct for this type. You need to use a java.sql.Timestamp to get …

  8. java - Convert between LocalDate and sql.Date - Stack Overflow

    Apr 20, 2015 · The Java 8 version (and later) of java.sql.Date has built in support for LocalDate, including toLocalDate and valueOf(LocalDate). To convert from LocalDate to java.sql.Date you …

  9. java - Using setDate in PreparedStatement - Stack Overflow

    About java.time. The java.time framework is built into Java 8 and later. These classes supplant the troublesome old legacy date-time classes such as java.util.Date, Calendar, & …

  10. How to subtract two java.sql.Date dates? - Stack Overflow

    Aug 6, 2011 · It's been seven years, so I've forgotten... :-). But at least two people have found it helpful! I think the point was that you can convert java.sql.Date objects to Strings which can be …

Refresh