🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.language
2 messages
2 total messages Started by Brunet Djura Sun, 12 Feb 2006 15:51
I need something like app.path or project.path (which is not user.dir)
#225
Author: Brunet Djura
Date: Sun, 12 Feb 2006 15:51
32 lines
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.
Re: I need something like app.path or project.path (which is not user.dir)
#170
Author: Oliver
Date: Thu, 30 Mar 2006 14:19
18 lines
1379 bytes
Hi,

i came across a similar problem (i have a Java application,
 which only needs to work under Windows) and i use an own 
system variable. This system variable could f.ex. be created by
 the Installer program (or manually by the user).

Since Java 1.5 one can retrieve the system variables 
with getenv().

Imo Java cannot be blamed when user.dir is different on Linux 
and Windows. The OS is also part of the system variables (well
 at least it is on my W2k).

regards

Oliver
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads