Most formally we use the now(); method... For Now() method it display the current date. If use now method directly in pst = con.prepareStatement ("insert into uploadfilename values('" + uf.id + "','" + myFileFilename + "','" + now() + "')"); int x = pst.executeUpdate(); I used this and execute it in the local database. It is updated in the database. but while executing in the live server it will through two exceptions InvocationTargetException and NoClassDefFoundError Exception. It will execute the current date in the database but it shows some warnings.. but it is not the correct way to display the date Date d = new Date();...