• 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
Posts: 65666
129
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
Sheriff
Posts: 36031
432
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!