wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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

How to set Date data type into varible

feng fu

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

Joined: Jan 10, 2002
Posts: 60752

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

Joined: May 26, 2003
Posts: 30068

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
It is sorta covered in the JavaRanch Style Guide.
subject: How to set Date data type into varible
Similar Threads
Passing specific format date to callable statement
set Enviornment Varibles for session beans
how to test for which primitive type a varible is
java date