File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes date and time in sql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "date and time in sql" Watch "date and time in sql" New topic

date and time in sql

kirupa shankari

Joined: Mar 16, 2001
Posts: 8
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

Joined: May 05, 2000
Posts: 13974
java.util.Date d = new java.util.Date();
java.sql.Date date = new java.sql.Date(d.getTime());
preparedStatement.setDate(colNum, date);

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: date and time in sql
It's not a secret anymore!