Article View: borland.public.jbuilder.java.language
Article #225I need something like app.path or project.path (which is not user.dir)
From: Brunet Djura
Date: Sun, 12 Feb 2006 15:51
Date: Sun, 12 Feb 2006 15:51
32 lines
2422 bytes
2422 bytes
I'm working on a database application in Borland JBuilder 2006 on Linux
Fedora Core 4 platform. I choose JDataStore as database, and
JasperReports for reporting part.
My connection code looks like this >
String app_path = "/home/brunetdj/my/source/jbuilder/info2006/";
String db_path = app_path + "data/podaci.jds";
database.setConnection(new ConnectionDescriptor("jdbc:borland:dslocal:"
+ db_path,"SYSDBA", "masterkey", false,
"com.borland.datastore.jdbc.DataStoreDriver"));
So, my problem is in variables app_path and db_path,
which is useless in MS Windows platform, and program stop working.
Application and database path are not the same semantics in both OS.
And where is that transparency of Java in that two small variables ?
I've searched Internet (Google,Sun forums, e.t.c.), but without results.
There is some partial solutions, like >
- to put database in class of project, and get path with getResorce()
method. That is unpractical because of huge database size
- to put all resources in root project folder, which also make chaos
with files
- to use system variable user.dir, which retrieve root user folder on
Linux, and different in MS Windows
Is there a way to use some methods to get app.path or project.path ?
Absolute adresses is untransparent on diferent operating systems.
Please, help, if anybody can.
Technical Details
Message-ID:
<43ef57f3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f74b3,7431e349e9f8218f,start X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 12 Feb 2006 16:51:18 +0100 From: Brunet Djura <djura.brunet@pkv.co.yu> User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: I need something like app.path or project.path (which is not user.dir) Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.240.36.10 Message-ID: <43ef57f3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1139759091 213.240.36.10 (12 Feb 2006 07:44:51 -0700) Lines: 32 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail