This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi Friends, Could you tell me how can I get sysdate in my java program to put it in my table?(I know I have to use today() I guess!!! but how? Thanks, Elahe
and also the return type should be date not string... Thanks, Elahe
Joel Cochran
Ranch Hand
Joined: Mar 23, 2001
Posts: 301
posted
0
Date sysDate = new Date(); String dateString = sysDate.toString();
Wait a minute, I'm trying to think of something clever to say...<p>Joel
Elahe Shafie
Ranch Hand
Joined: Dec 12, 2001
Posts: 291
posted
0
Thanks Joe, I used that but it gives me this error and even though setSubmittedDate is date type in oBug. Do you have any idea? Thanks, ELahe No method found matching setSubmittedDate(Date) oBug.setSubmittedDate( dtSubmittedDate ); ^ 1 error
and here is part of Bug
Elahe Shafie
Ranch Hand
Joined: Dec 12, 2001
Posts: 291
posted
0
I fixed the problem by adding java.sql.Date as you can see bellow: java.sql.Date dtSubmittedDate = new java.sql.Date(new Date().getTime()); but why it should get fix by adding this I want to know the reason not just solved it!!! Any idea? Thanks, Elahe
Mahesh Mamani
Ranch Hand
Joined: Jun 25, 2001
Posts: 110
posted
0
Hi, U'll have to see the type of Date imported in Bug class(java.util.Date or java.sql.Date)...This may lead to a conflict...If u r using it to update to database, then better use java.sql.Date, to be on the safer side. Mahesh
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
If you imports for both java.util and java.sql, you could have a problem as both packages have a Date class in them.
Elahe Shafie
Ranch Hand
Joined: Dec 12, 2001
Posts: 291
posted
0
Oh I see... by the way what is the difference between java.util and java.sql ? Thanks, Elahe
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
java.sql is the package that contains JDBC support classes.
Elahe Shafie
Ranch Hand
Joined: Dec 12, 2001
Posts: 291
posted
0
Thanks
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.