Results 1 to 6 of 6
Thread: java.util.Date vs java.sql.Date
- 07-09-2007, 03:20 AM #1
Senior Member
- Join Date
- Jun 2007
- Posts
- 130
- Rep Power
- 0
- 07-09-2007, 03:22 AM #2
Senior Member
- Join Date
- Jun 2007
- Posts
- 132
- Rep Power
- 0
Java.util.Date is a basic, all-purpose Date object. It simply stores a Date (as a long) and allows you to display it.
java.sql.Date extends java.util.Date to add the following functionality:
1) toString now outputs the date as "yyyy-mm-dd" instead of as a Locale specific String
2) add the valueOf method to read a String of "yyyy-mm-dd" format and parse it into a sql.Date object.
- 12-18-2008, 11:22 AM #3
Member
- Join Date
- Dec 2008
- Posts
- 5
- Rep Power
- 0
The above information was helpful. Can we extract Time information from java.sql.Date api?
- 12-18-2008, 09:37 PM #4
Yes, the Java standard Date is really a DateTime. Its poorly named.
And it is far harder to use than it should be. They layered in the Calendar classes in a fairly early version (java 1.2?) which made it less terrible to use if you are using western european GregorianCalendars. But its still far harder to use than it should be.
And there are threading issues with some of the SimpleDateFormat classes.
There is a replacement, JodaTime that is a clean design. It supports many more calendars (hebrew, islamic, etc.) and has a far more obvious API
The whole java.sql.Date vs java.lang.Date thing is another example of hurried design and is a hack.
- 04-05-2009, 02:53 AM #5cheapcarsauctions Guest
Hello From Poland
Hello to all ! Great site. I am new here greetings to all from Poland.
- 10-28-2010, 02:59 PM #6
Member
- Join Date
- Oct 2010
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
Difference between current date and anothe date
By vijay balusamy in forum New To JavaReplies: 1Last Post: 04-16-2008, 04:15 PM -
java Date and Calendar
By valoyivd in forum New To JavaReplies: 1Last Post: 03-30-2008, 06:49 PM -
PreparedStatement with java.sql.Date
By Java Tip in forum Java TipReplies: 0Last Post: 02-10-2008, 11:39 AM -
Using java.sql.Date
By Java Tip in forum Java TipReplies: 0Last Post: 02-10-2008, 11:32 AM -
Java Date
By levent in forum Java TutorialReplies: 0Last Post: 08-05-2007, 01:57 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks