aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes how to access data class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "how to access data class" Watch "how to access data class" New topic
Author

how to access data class

kevin chang
Ranch Hand

Joined: Mar 08, 2003
Posts: 64
i try to access data class with line below
but it does no use and always output "file not found" , can somebody help,and give me some code about access data class!
try{ Data dbfile=new Data("db.db");
System.out.println(dbfile.getRecordCount());
}catch(IOException e){System.out.println("file not found");};


Sun Certified Java Programmer, Sun Certified Java Developer. <br />Strving to be a real architect.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
To the person behind this displayed name, welcome to JavaRanch. However, you must change your displayed name to one conforming to the JavaRanch naming policy. Thank you.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Hi Kevin, well is it really file not found? Is there a db.db file in the working directory? Are you trying to open a file for writing when it is read only? If creating a new file do you have write access to the directory where the file is to reside?
You could use e.printStackTrace() in the catch clause, it may give more information as to what is causing the IOException and which line is causing the problem.
Without knowing the internals of your Data class I cannot see where the problem lies.
kevin chang
Ranch Hand

Joined: Mar 08, 2003
Posts: 64
problem solved , thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to access data class