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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 60045
    
  65

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


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

Joined: May 26, 2003
Posts: 29219
    
135

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set Date data type into varible
 
Similar Threads
set Enviornment Varibles for session beans
java date
how to test for which primitive type a varible is
Passing specific format date to callable statement
SimpleDateFormat