How can I Convert Java Timestamp (Timestamp data type) to MySQL timestamp vice versa?
How can I Convert Java Timestamp (Timestamp data type) to MySQL timestamp vice versa?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re using the JDBC API to access the database, and you’re using a
PreparedStatementto for example execute an SQL INSERT statement, then you just set the timestamp as a parameter to thePreparedStatement:Likewise, when you’re doing a query that returns a timestamp, get it from the
ResultSetby callinggetTimestampon it. Example:See the JDBC Tutorial.