Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2005

Tip: Looking for answers? Try searching our database.

Cannot find method error

Thread view: 
Andreas Ernst - 20 Mar 2005 13:00 GMT
I want to use the Time class in Java.
Therefore i included the line

import java.sql.Time;

in my code.
The proble is, that javac reports:

sieve.java:28: error:Cannot find method "java.sql.Time()"

I use

javac: Version 2.1B released 17. July 2002

I have also jre1.4.2 installed, but in

/usr/local/j2re1.4.2/bin

I cannot find the javac Compiler.

Whats the solution to my problem?

Thanks in advance,

Andreas
Roland - 20 Mar 2005 13:32 GMT
> I want to use the Time class in Java.
> Therefore i included the line
[quoted text clipped - 21 lines]
>
> Andreas

Class java.sql.Time does not have an argumentless constructor.
Instead, use the one that takes a long as argument:
   new java.sql.Time(12345678L);

But... are you actually dealing with SQL TIME values? That's what
java.sql.Time is intended for. Otherwise it's better to use
java.util.Date, java.util.Calendar and its subclasses for general
date/time manipulation.
Signature

Regards,

Roland de Ruiter
  ___      ___
 /__/ w_/ /__/
/  \ /_/ /  \



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.