Solved

JAVA:Please explain:sdf.parse(rs.getTimeStamp("yourDateColumn"));

Posted on 2006-06-09
10
329 Views
Last Modified: 2008-01-16
sdf.parse(rs.getTimeStamp("yourDateColumn"));
what is rs.  
0
Comment
Question by:coolgem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16871759
It would appear to be a ResultSet instance.
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html
0
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16871772
It's merely a class typically used to encapsulate the returned data (the result set) of a query, performed on a database for example.
0
 

Author Comment

by:coolgem
ID: 16872274
Ok.  Thank you. will you please explain How I may do a SimpleDateformate to set it to only  dd mmm yyyy in a  getter method?
Thank you agin for your time
CG
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16872409
SimpleDateformat sdf = new SimpleDateformat( "dd MMM yyyy" ) ;

Date d = sdf.parse(rs.getTimeStamp("yourDateColumn")) ;
0
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16872418
(Should of course be "SimpleDateFormat" instead)
                                                ^
                                            capital F
0
 

Author Comment

by:coolgem
ID: 16872566
Why are we using the result set? I did not want to have to do it that way. How about right in the getterMethod(). I dont need a yourDateColumn either. I'm using a name in the getter or right in the setter with the date being a String object.
I apologize for my misunderstanding.
0
 
LVL 25

Accepted Solution

by:
InteractiveMind earned 250 total points
ID: 16872645
Hm, I'm still not 100% clear (sorry, am quite tired :P).

Show me what you've currently got -- I'm sure that'll clarify some things for me.
0
 

Author Comment

by:coolgem
ID: 16872855
While in a setter and after getting a field as a result of an sql Select. Take the field in the setter and format it with simpleDateformat to "dd MMM yyy". The getter field should look like "dd MMM yyyy".

public void setTheDate(String string) {
                  
            theDate  = dateFormat.format(string);
}
I'm trying this now.
thank you
0
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 16873165
I assume you got it working then?

Thanks for points :)
0
 

Author Comment

by:coolgem
ID: 16873176
You are welcome. You are always a great help. CG
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Arduino EDI - Programming Language - Voice Recorder 4 107
Definitions and default visual studio colors 5 74
ASP/VB email question 4 63
MySQL programmer starter 25 34
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question