Date vs Milliseconds | for scalablility, saving, searching and obtaining time in Java + MySQL(or other Db's)

Which is the most beneficial in Java and a DB for DateTime? (Using JodaTime as Date) (DateTime object (Java) **+** TIMESTAMP (DB) ) **VS** (Milliseconds long (Java) **+** BIGINT(DB) for the use of DateTime information in Java Web application backed by an underlying Database Areas of interest - manipulating, processing and memory usage in Java - saving using efficient storage space in a MySQL database - ease of porting a BIGINT/TIMESTAMP column to other DBs - ease of searching the DB for a BIGINT/TIMESTAMP or between two BIGINTs/TIMESTAMPs E.g. Say I had an event with a start & end DateTime. Is it faster to search for events on dates using BIGINT in the DB than TIMESTAMPS I might be swapping the underlying DB as scalability and retrieval issues arise. Would saving the DateTime as a TIMESTAMP in a MySQL DB lead problems when porting to another DB like Oracle? ---- I currently use the Joda DateTime in java then storing the millisecond of that value. When retrieving it, I convert the milliseconds back to a DateTime object and display it.

以上就是Date vs Milliseconds | for scalablility, saving, searching and obtaining time in Java + MySQL(or other Db's)的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏