Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PLS help me about file access!!

 
sparkle zou
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that your jar structure? Your db.db file does not need to be in your jar.
 
sparkle zou
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not in Jar;just in source code~!
 
sparkle zou
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get it!
use
dataWrapper = new Data("..//db//db.db");
instead of
dataWrapper = new Data("../db/db.db");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic