on ‎2007 Jun 19 2:52 AM
Hi All,
What is the difference between java.sql.date and java.util.date and which is more preferable to use .How to convert date from one form to another .
Thanks.
Request clarification before answering.
Hi kl..
java.util.date is the java representation of date and time. Use this if you want to deal with dates or times in your java program (add, substract etc).
java.sql.date is for use only if you want to communicate with a SQL-Database like MySQL, MSSQL, PostGreSQL or so. Don't use it for the above mentioned stuff.
If you were using it for SQL-stuff, I guess you'd know that, so perhaps java.util.date is the right one for you.
I believe java.util.Date includes time (HH:MM:SS); java.sql.Date does not.
java.sql.Timestamp allows you to hold onto database timestamps down to the millisecond. - MOD
Urs GS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.