From: thhal at mailblocks.com (Thomas Hallgren) Date: Thu, 11 Nov 2004 21:08:45 +0100 Subject: [Pljava-dev] reading a file In-Reply-To: <000901c4c826$a24c2c30$cd8055aa@ftgebus33> References: <000901c4c826$a24c2c30$cd8055aa@ftgebus33> <4193C6CD.1040700@mailblocks.com> Message-ID: Russ, >Hi, >I wrote a Java class that needs to read in a properties text file. >Where should I put the properties file in the Postgres environment so >my class doesn't get a "File not found" error? >Thanks, >Russ > > PL/Java doesn't have an opinion about the location of files. I guess that what you are after is some mechanism that would allow you to use a path that is relative to your PostgreSQL environment? If you're using PostgreSQL 8.0, you can accomplish this by defining a property in the postgresql.conf file. Simply add the following: pljava.vmoptions = '-Dpgsql.home=/the/path/to/the/pgsql/dir' You can access this property from Java using: String pgsqlHome = System.getProperty("pgsql.home"); I know this is perhaps not a perfect solution. Suggestions on improvements are more then welcome. Regards, Thomas Hallgren