This maven project is a convenient way for running derby without having to download and install it.
The maven project uses the maven plugin derby-maven-plugin to start the derby network server.
Usage example:
mkdir -p ~/git cd ~/git/ git clone https://github.com/steinarb/derby-runner.git cd derby-runner mvn install mvn derby:run
At this point derby server will be running and listening on port 1527 until Ctrl-C is pressed.
It is possible to connect to the server with a client such as e.g. Squirrel SQL using the url jdbc:derby://localhost/dbname (replace “localhost” with the hostname of the machine running the derby network server if connecting from a different computer, and replace “dbname” with the name of your database).
Note! Squirrel SQL requires a non-empty username and password on derby network connections, even if the server doesn’t require them. Use APP/APP for username/password (“APP” as the username will select the “APP” schema as the default schema, which is what you usually want, and the password can be any non-empty string).
It is also possible to start the derby ”ij” client from a sub-project of this project.
To get an “ij” client running and connected:
- open a new command line window, and type:
cd ~/git/derby-runner/run-derby-ij/ mvn exec:java - Then connect to a an existing database named “dbname” on the local server:
connect 'jdbc:derby://localhost:1527/dbname';If “dbname” doesn’t exist on the server, a new empty database can be created with the URL:
connect 'jdbc:derby://localhost:1527/dbname;create=true;' - Type commands at the “ij>” prompt, e.g.
show tables; - To end the “ij” session, give the command:
exit;
The license for this git repository is Apache Public License v2.
See the LICENSE file for details.