HI,
Just make use of this function to enter date into MsAccess database.
public static java.sql.Date getCurrentJavaSqlDate() {
java.util.Date today = new java.util.Date();
return new java.sql.Date(today.getTime());
}
So now when you want to make an entry of date into database just call this function and store it in for example say java.sql.Date object, and set it using the prepared statment. For example suppose ps is your prepared statement then ps.setDate(int,your date object) should set the date.
A sample code below to help understand:-
String sol= "INSERT into storage1([Items],[Spaceocc],[Date]) VALUES (?,?,?)";
ps2=con.prepareStatement(sol);
if(proceed){
ps2.setString(1,"Set");
ps2.setInt(2, 0);
java.sql.Date date = getCurrentJavaSqlDate();
ps2.setDate(3,date);
ps2.executeUpdate();
}
Hope this works.