• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

how to update one column of my table?  RSS feed

 
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
 
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
 
A teeny tiny vulgar attempt to get you to buy our stuff
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!