• Post Reply Bookmark Topic Watch Topic
  • New Topic

date and time in sql

 
kirupa shankari
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to get the current system time and date and store it in Ms- Access database using java.sql package?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.util.Date d = new java.util.Date();
java.sql.Date date = new java.sql.Date(d.getTime());
preparedStatement.setDate(colNum, date);
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!