Apache Derby as an Admin Database

(Advanced Users) You can run Live API Creator in Jetty using Apache Derby as your admin database instead of MySQL.

Limitations: Live API Creator supports Apache Derby only in embedded mode. In this mode, Apache Derby does not support cluster configurations. Only one server can access the database at any given time.

Verify Prerequisites

Ensure that you have completed the following prerequisites:
  • The Derby JAR is in the {CATALINA_HOME}/lib directory.
  • You have configured Jetty, as described in Install the Jetty package.

Configure Derby

Open the %CATALINA_HOME%/conf/server.xml file, insert the following XML code within the <GlobalNamingResources> tag, save your changes, and close the file:
<Resource accessToUnderlyingConnectionAllowed="true"
auth="Container"
defaultAutoCommit="false"
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
initialSize="0"
logAbandoned="true"
maxActive="10"
maxIdle="0"
maxWait="15000"
minIdle="0"
name="jdbc/AdminDB"
removeAbandoned="true"
removeAbandonedTimeout="30"
timeBetweenEvictionRunsMillis="30000"
type="javax.sql.DataSource"
url="jdbc:derby:/Users/jdoe/CALiveAPICreatorAdmin;create=true"
username="CALiveAPICreatorAdmin"/>

The url parameter must point to the directory for an existing admin database or to a non-existing directory which will be created. You can specify any path in the URL. On Windows, you can specify a drive, for example:
jdbc:derby:d:\Users\jdoe\CALiveAPICreator;create=true

Note: The create=true parameter creates a new database directory if one does not exist. This is usually desirable, at least for the first time.

For more information about the JavaDB URL, see the Development Guide on the Apache.org site.

If you have a port conflict with the default 8080 port, open the start.ini file in the home folder and change the following snippet:

## Connector port to listen on

jetty.http.port=8080