• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set Date data type into varible

 
feng fu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I sign the data type 'Date' from the database into a varible?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harldy a JSP question, is it? Moving to the JDBC forum.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34669
366
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Feng,
The resultset object has getDate() and getTimestamp() methods. These will let you get your date in the database into a java.util.Date or java.sql.Timestamp object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic