?
Solved

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

Posted on 2006-06-09
10
Medium Priority
?
339 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
Technology Partners: 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 1000 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

Independent Software Vendors: 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!

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Six Sigma Control Plans
Progress

764 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