Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to update one column of my table?

 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,
I want to read my table and write it again with updated data like(Wed Jan 19 16:26:37 PST 2001 and change it to 1/19/2001)so how can I update this column data through my servlet?
Any advice?
Many thanks,
Elahe
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or mybe it is clear to ask this way that how can I read date like this format from database:
Wed Feb 19 16:26:37 PST 2001
Wed Jan 02 12:22:40 PST 2002
and write it like:
2/19/2001
1/02/2002
I need to update all data in date column.
I hope it is clear this time...
Many Thanks,
Elahe
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should read it out of the database as a Date, and then format it for the user:

to update the database, get the formatted String date, parse it into a Date object, write the date object to the database:

Jamie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic