aspose file tools*
The moose likes JDBC and the fly likes How to set Date data type into varible Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to set Date data type into varible" Watch "How to set Date data type into varible" New topic
Author

How to set Date data type into varible

feng fu
Greenhorn

Joined: Feb 24, 2004
Posts: 8
How can I sign the data type 'Date' from the database into a varible?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Harldy a JSP question, is it? Moving to the JDBC forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30776
    
157

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Don't get me started about those stupid light bulbs.
 
subject: How to set Date data type into varible