Download and install Apache Derby in you computer, if it is not already done.
Goto the <derby-installation directory>/bin directory and run the derby network
server starting script. Usually this is named as "startNetworkServer".
Setup Configuration Files
Edit the registry.xml file (inside the $CARBON_HOME/conf directory) of the
deployed registry instance as below (note the highlighted configurations, You
may use your own database name, username and password).
Explanation of the database configuraiton options.
url: The URL of the database
userName: The name of the database user
password: The password of the database user
maxActive: The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit.
maxWait: The maximum number of milliseconds that the pool will wait (when there
are no available connections) for a connection to be returned before throwing an
exception, or <= 0 to wait indefinitely.
minIdle: The minimum number of active connections that can remain idle in the
pool, without extra ones being created, or 0 to create none.
NOTE: In contrast to the embedded registry, in remote registry you will set the database driver name ("driverName" element) to the value "org.apache.derby.jdbc.ClientDriver" and the database url ("url" element) to the database remote location.
Edit the user-mgt.xml file (inside the $CARBON_HOME/conf directory) of the deployed instance as below
(Note that you have to replace these settings with your custom values).
Place derby.jar, derbyclient.jar and derbynet.jar in the
$CARBON_HOME/lib/extensions directory (to the class path of the WSO2 Registry web
application)
Create Database
Automatic Database Creation
Next at the first time you start the regisry, run with the -Dsetup option, so
it will create the Derby database.
wso2server.sh -Dsetup (in linux)
wso2server.bat -Dsetup (in windows)
You just configured WSO2 Registry to run using a remote Apache Derby database.
Manual Database Creation
Run the ij tool located in the <derby-installation directory>/bin directory.
Create the registry database and connect to it using the following command
inside the ij prompt (replace the database file path, user name and password in
below command to suite your requirements).
Now Exit from the the ij tool by typing the exit command.
exit;
Now login to the 'ij' tool with the username and password you just used to
create the database.
connect 'jdbc:Derby:db' user 'regadmin' password 'regadmin';
Run the derby scripts for both registry and user manager (embedded inside the
Registry) databases, provided with the WSO2 Registry using the below
commands.
run 'CARBON_HOME/dbscripts/common/derby-registry.sql';
run 'CARBON_HOME/wso2registry/dbscripts/usermanager/um-derby.sql';
Restart the wso2 registry instance. Now WSO2 Registry is running using a remote Apache
Derby database!
Setting up Database - Derby - Embedded
Preparing the Derby Database
Download and install Apache Derby in you computer, if it is not already done.
Setup Configuration Files
Edit the registry.xml file (inside the $CARBON_HOME/conf directory) of the
deployed registry instance as below (note the highlighted configurations, You
may use your own database name, username and password).
Explanation of the database configuraiton options.
url: The URL of the database
userName: The name of the database user
password: The password of the database user
maxActive: The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit.
maxWait: The maximum number of milliseconds that the pool will wait (when there
are no available connections) for a connection to be returned before throwing an
exception, or <= 0 to wait indefinitely.
minIdle: The minimum number of active connections that can remain idle in the
pool, without extra ones being created, or 0 to create none.
NOTE: In contrast to the remote registry, in embedded registry you will
set the database driver name ("driverName" element) to the value
"org.apache.derby.jdbc.EmbeddedDriver" and the database url ("url" element) to
the database directory location relative to the registry installation. (In the
above sample configuration it is inside the "database/WSO2CARBON_DB" directory)
Edit the user-mgt.xml file (inside the $CARBON_HOME/conf directory) of the deployed instance as below
(Note that you have to replace these settings with your custom values).
Place derby.jar, derbyclient.jar and derbynet.jar in the
$CARBON_HOME/lib/extensions directory (to the class path of the WSO2 Registry web
application)
Create Database
Automatic Database Creation
Next at the first time you start the regisry, run with the -Dsetup option, so
it will create the Derby database.
wso2server.sh -Dsetup
wso2server.bat -Dsetup
You just configured WSO2 Registry to run using the embedded Apache Derby.
Manual Database Creation
Run the ij tool located in the <derby-installation-directory>/bin directory.n directory>/bin directory.
Create the registry database and connect to it using the following command
inside the ij prompt (replace the database file path, user name and password in
below command to suite your requirements).
NOTE: Here you need to give the full path to your registry database in place of "/WSO2CARBON_DB"
Now Exit from the the ij tool by typing the exit command.
exit;
Now login to the 'ij' tool with the username and password you just used to
create the database.
connect 'jdbc:Derby:db' user 'regadmin' password 'regadmin';
Run the derby scripts for both registry and user manager (embedded inside the
Registry) databases, provided with the WSO2 Registry using the below
commands.
run 'CARBON_HOME/dbscripts/common/derby-registry.sql';
run 'CARBON_HOME/dbscripts/usermanager/um-derby.sql';
start the wso2 registry instance.
wso2server.sh (in linux)
wso2server.bat (in windows)
Now WSO2 Registry is running using the embedded Apache
Derby database!