db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: SYSCS_GET_DATABASE_PROPERTY not working?
Date Thu, 13 Sep 2007 19:38:44 GMT
David Van Couvering <david@vancouvering.com> writes:

> On 9/12/07, Øystein Grøvlen <Oystein.Grovlen@sun.com> wrote:
>> David Van Couvering wrote:
>>  > OK, fair enough.  So, how *do* I find out what derby.system.home is
>> set to??
>>  >
>>
>> I would think it is the same way as with any Java System property
>> (Kathey implicity told you that):
>>
>>      System.getProperty("derby.system.home");
>
> Yes, I know that.  But if I'm running the network server, how am I
> supposed to find out what the network server thinks is
> derby.system.home?  Especially if I'm interacting with Derby from a
> tool like NetBeans.  It could very well be that the developer is using
> JRuby or even PHP with ODBC, and is not even a Java programmer.

If your network server has the necessary permissions to read
derby.system.home and user.dir (in case derby.system.home is null), you
could do something like this:

ij version 10.3
ij> connect 'jdbc:derby://localhost/mydb;create=true';
ij> create function getSystemProperty(name varchar(128)) returns varchar(128) language
java external name 'java.lang.System.getProperty' parameter style java no sql;
0 rows inserted/updated/deleted
ij> values getSystemProperty('derby.system.home');
1                                                                                        
                                      
--------------------------------------------------------------------------------------------------------------------------------
NULL                                                                                     
                                      

1 row selected
ij> values getSystemProperty('user.dir');
1                                                                                        
                                      
--------------------------------------------------------------------------------------------------------------------------------
/tmp                                                                                     
                                      

1 row selected


-- 
Knut Anders

Mime
View raw message