aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes pubzzle of db-file-path expression? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "pubzzle of db-file-path expression?" Watch "pubzzle of db-file-path expression?" New topic
Author

pubzzle of db-file-path expression?

he qinfeng
Greenhorn

Joined: Sep 13, 2003
Posts: 23
Hi everyone:
When the program run in local mode,it allow user to input the db-file-path and db-file-name.if the db file located E:\javacode\db.db,the db-file-path is E:\javacode\ or E:\javacode in JTextField?
I think E:\javacode\ is better,db-file-path add db-file-name is ok.But E:\javacode is familiar with user ,and if on Win32,db-file-path + "\" + db-file-name is ok,if on Solaris,db-file-path + "/" + db-file-name is ok,it's difficult to judgement.
Thanks for your answer.


SCJP<br />SCJD(in progress)
Charlie Goth
Ranch Hand

Joined: Feb 26, 2004
Posts: 60
JFileChooser


SCJP (77%)
Pedro Penna
Ranch Hand

Joined: Jun 05, 2004
Posts: 46
There are other classes in the swing package that you could use for the input of the db-file-path, instead of using JTextField.

And the normal slash '/' is the default directory separator. For example, the path "dir1/dir2/file.db" is compatible with Windows.
he qinfeng
Greenhorn

Joined: Sep 13, 2003
Posts: 23
Thanks
JFileChooser is the better way,and I will use it to work out.
Jon Entwistle
Ranch Hand

Joined: Feb 20, 2003
Posts: 118
Hi He,

Just for reference, you can always access the system dependant seperator from the static File.separator variable.

Regards,

Jon


SCJD, SCEA
he qinfeng
Greenhorn

Joined: Sep 13, 2003
Posts: 23
Thanks Entwistle.
By your opinion,I also solved my problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pubzzle of db-file-path expression?
 
Similar Threads
org.hibernate.TransactionException: Transaction not successfully started
NX: Contractor 2.3.1 Ambiguities in the Spec
storage of files in website
Properties Files and ResourceBundle
using external jar files