Senthil Kumar
Senthil Kumar

Reputation: 375

error in mysql prepared statement timestamp?

I'm using mysql to develop basic ddl statements but I created table with datatype of timestamp and getting an error as invalid statement for timestamp. And my code is :

ps.setTimestamp(4, m_datetime);

Thanks in advance.

Upvotes: 1

Views: 402

Answers (1)

John Woo
John Woo

Reputation: 263723

ps.setTimestamp(4, m_datetime);

make sure that m_datetime has the proper timestamp format and its data type is java.sql.Timestamp

Upvotes: 3

Related Questions