db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Embretsen <John.Embret...@Sun.COM>
Subject Re: where we shoul use derby.drda.* and where the file should be placed
Date Thu, 12 Oct 2006 10:27:34 GMT
legolas wood wrote:

> Thank you for reply. it helps
> so i should put the properties file inside the 
> *frameworks\NetworkServer\bin *folder

If that is where you start the server (for example if you use the 
startNetworkServer.bat script), yes.

(By the way, I think that from version 10.2.1.6, the frameworks\... scripts are 
deprecated, and that new ones under bin\ should be used instead.)

> how we can apply database wide properties ? should we create a 
> properties file and put it in  some place ?

According to the Derby manuals (http://db.apache.org/derby/manuals/index.html), 
database-wide properties can only be set by using system procedures within SQL 
statements. The "Tuning Derby" manual explains how to set database-wide properties:

http://db.apache.org/derby/docs/dev/tuning/ctunsetprop12821.html

It may be helpful to walk through the "Properties case study" example (in the 
same section of the Tuning manual) to understand the difference between 
database-wide and system-wide properties, precedence and persistence. It also 
shows how to set a database-wide property using JDBC:

http://db.apache.org/derby/docs/dev/tuning/ctunsetprop32443.html

There is a page in the reference manual showing how to set database-wide 
properties using either SQL (for example in IJ) or JDBC (Java code). The system 
procedure is called SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY:

http://db.apache.org/derby/docs/dev/ref/rrefsetdbpropproc.html

If, for example, you want to set the property derby.locks.deadlockTimeout=10, do 
(after connecting to the database):

SQL:

CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY
('derby.locks.deadlockTimeout', '10');

JDBC:

CallableStatement cs = conn.prepareCall
         ("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?, ?)");
cs.setString(1, "derby.locks.deadlockTimeout");
cs.setString(2, "10");
cs.execute();
cs.close();


There is also a system function for fetching an existing database-wide property, 
and that function is called SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY. You can look 
it up in the reference manual if you need more information.


-- 
John



Mime
View raw message