Need help to write a update query to update current (sysdate) from JSP to mysql database.
The problem is mysql will store data field in yyyy-mm-dd format.
So how to go about it.
Thganks
The problem is mysql will store data field in yyyy-mm-dd format.
What is the problem with that? Besides, if the DB field is of type timestamp or some such, then it has no format associated with it - any formatting would need to be done by the client.
Jaidev,
It is good practice to use a PreparedStatement. Then you can call setDate() and getDate() rather than worrying about database specific formatting. And use SimpleDateFormat to display in the desired format in your JSP.
It is also good practice to do your JDBC code from someplace other than a JSP.