This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes PLS help me about file access!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "PLS help me about file access!!" Watch "PLS help me about file access!!" New topic
Author

PLS help me about file access!!

sparkle zou
Greenhorn

Joined: Dec 02, 2002
Posts: 7
now the file struct is like the bellow:
<root>/db
db.db
<root>/server
RemoteDataImp.java
how to write the code in RemoteDataImp.java to access file db.db??
the code writen bellow is wrong!
dataWrapper = new Data("../db/db.db");
Brian Blignaut
Ranch Hand

Joined: Jan 08, 2003
Posts: 61
Is that your jar structure? Your db.db file does not need to be in your jar.
sparkle zou
Greenhorn

Joined: Dec 02, 2002
Posts: 7
Not in Jar;just in source code~!
sparkle zou
Greenhorn

Joined: Dec 02, 2002
Posts: 7
I get it!
use
dataWrapper = new Data("..//db//db.db");
instead of
dataWrapper = new Data("../db/db.db");
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: PLS help me about file access!!
 
Similar Threads
(NX)path of db file
how do you people plan to give the source files
URLyBird Packaging
location of DB.DB file
Thoughts wanted READMDE.txt