hi ranchers ! i have a confusion with the Date() method of the java.util package and the java.sql date() method.i have created a table with ms Access with a field data type as Date.what is the difference between these two Date method.which date format will not throw the Exception and which will be more accurate to this date format.plese someone answer to me.
Java sql Date extends Java util Date In other words it has more methods and provides more functionality It is always better to use java.sql.Date to get enhanced functionality
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
hi ranchers i want to get the current time and date by uding the java.sql.Date() method and insert this into the database.is anyone can give the code for this.thanks.
// get current Date as java.util.Date // convert to milliseconds // create java.sql.Date for JDBC code long currentTime = new java.util.Date().getTime(); java.sql.Date dateToInsert = new java.sql.Date(currentTime);