Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{scrollbar}

Excerpt

This topic is about how to

To

create a new embedded database in Geronimo with available DB Manager and configure the location of embedded Derby system database to another location instead of the default /var/derby directory.

Table of Contents

Creating a new database

the DB Manager portlet is available. Near the bottom of the Console Navigation menu navigate through Embedded DB -> DB Manager. This portlet triggers the DB Viewer and Run SQL portlets illustrated in the following figures.

...

The DB Viewer portlet displays all the available databases, their tables (application and system) and displays the the table contents of the tables. Click on the Application link to work with database application tables. Click on the System link to work with database system tables.

...

To create a test database, specify test in the Create DB: field and click on Create. After a few seconds you should will see a confirmation message near the bottom of the Run SQL portlet, stating Database created: test. You should now see will find the test database entry in the DB Viewer portlet.

If you want to run any SQL command on this database make sure you select test from the Use DB: pull-down menu, enter the SQL command and then click on the Run SQL button. The results of the command will be displayed near the bottom of the portlet.

Configuring the location of system Derby databases

By default, all system databases are created in the /var/derby directory when Geronimo server starts up for the first time. You can override the default derbySystemHome attribute of the DerbySystem GBean. Find the system-database module in /var/config/config.xml and it looks like as below:

Code Block
xml
xml
titleexcerpt of config.xml

   <module name="org.apache.geronimo.configs/system-database/2.2/car">
       <gbean name="DerbyNetwork">
           <attribute name="host">${ServerHostname}</attribute>
           <attribute name="port">${DerbyPort + PortOffset}</attribute>
       </gbean>
       <gbean name="DerbySystem">
         <attribute name="derbySystemHome">var/derby</attribute>
       </gbean>
   </module>

Note that derbySystemHome can be configured to an absolute location or a relative one.