• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Want to show the TimeStamp on the form, but needs to save it back later

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When a complaint form shows up, I'd like to show the timestamp, do I get this from Java or MariaDB,

If from Java, I need to update this value and set the field type to DateTime

If from MariaDB, I need a stored procedure to generate a TimeStamp and display it on the form and save it back later.

Both seems very inlogical, what is the proper way of doing this?
Thanks
Jack
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Java, "new java.sql.Date()" creates the current date/time. You can then call stmt.setDate(1, new java.sql.Date()) to insert it in your database table.

I'm not familiar with stored procedures in MariaDB, but I'm sure it is possible. "now()" is often a database way of getting the current time.
reply
    Bookmark Topic Watch Topic
  • New Topic