Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • 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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic