cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

What is the difference between java.sql.date and java.util.date

Former Member
0 Likes
745

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.

View Entire Topic
Former Member
0 Likes

Hello Kl,

If you think from <b>WebDynPro and R/3</b> point of view Date is only <b>java.sql.Date.</b>

Depends upon Scenario we have to use

<u><b>Differences</b></u>

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.

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

Rgds

-SS