aspose file tools*
The moose likes JDBC and the fly likes Insert a row into MS Access2003 successfully,But the long date(YYYY/MM/DD HH:mm:ss) was changed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Insert a row into MS Access2003 successfully,But the long date(YYYY/MM/DD HH:mm:ss) was changed " Watch "Insert a row into MS Access2003 successfully,But the long date(YYYY/MM/DD HH:mm:ss) was changed " New topic
Author

Insert a row into MS Access2003 successfully,But the long date(YYYY/MM/DD HH:mm:ss) was changed

Jessen Gan
Greenhorn

Joined: Nov 23, 2011
Posts: 2
I inserted a row into MS Access2003 successfully by JAVA JDBC, but the long date (YYYY/MM/DD HH:mm:SS ) was changed to short date(YYYY/MM/DD) in access2003.

Even through,I changed the date time format of my local MS XP System to be 'YYYY/MM/DD HH:mm:SS',then insert another row into MSAccess2003 ,the date format be 'YYYY/MM/DD 00:00:00'.

This question boring me so much.

What's the reason be?

What should I do to fix it?

Any suggestion can help!
Suraj Jadhav
Greenhorn

Joined: Mar 10, 2010
Posts: 25
Check the format of field(Date in MS Access) in which you are inserting the record. I guess changing the format of operating system won't help. You need to check the format in MS Access how it is storing the data.
Jessen Gan
Greenhorn

Joined: Nov 23, 2011
Posts: 2
Thanks for Suraj Jadhav's suggestion:

I had changed the date format to (YYYY-MM-DD HH:mm:SS) of the row, not working good.

If I am not finding a fine solution of the question.

May be I should storing the date value to be varchar type int the MSAccess,then get results out, using SimpleDateFormat.format(String dateStr) method change String to Date type.

this is the second choose.
 
Consider Paul's rocket mass heater.
 
subject: Insert a row into MS Access2003 successfully,But the long date(YYYY/MM/DD HH:mm:ss) was changed