0

I have some problems with inserting a TimeStamp into the database(something is wrong with format. The db accepts dd.MM.yyyy). When I convert the Date to TimeStamp and then inserted it into the database, it fails. The format of TimeStamp is yyyy-MM-dd.

Do you have any ideas or suggestions?

1

2 Answers 2

1

If your DB really insists on dd.MM.yyyy and you have no option to use something like makedate(format, myDateInTheGivenFormat) then you have to do the reformatting within Java yourself.

Use SimpleDateFormat to reformat your date accordingly to the DB's needs.

Sign up to request clarification or add additional context in comments.

Comments

0

Please check the java.sql.Date, that can help you

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.