Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

Scout/HowTo/3.9/Modify a derby database

< Scout‎ | HowTo‎ | 3.9

The Scout documentation has been moved to

The following how-to explains how you can add other columns to an existing table in your database. The database used in this example is the database from the MiniCrm Tutorial

Download and install Derby

Access Derby database
Eclipse Scout comes with the JDBC drivers and this tutorial comes with a database but in order to make changes to the database you need to download Derby itself.

Install a binary distribution such as Switch to the bin subdirectory and start ij.bat. Connect to your database using the same connect string you used for the SQL service.

ij version 10.9
ij> connect 'jdbc:derby:c:/derbydb';
ERROR XJ040: Failed to start database 'c:/derbydb' with class loader sun.misc.Launcher$AppClassLoader...

ERROR XSDB6: Another instance of Derby may have already booted the database C:\DerbyDB

These error messages indicate that you might still have your Scout server running. It is locking the database. Stop the server in the Scout perspective and try again.

Operations on the database

Once connected here is how to examine the tables available:

 ij> show schemas;
 ij> show tables in minicrm;
 TABLE_SCHEM         |TABLE_NAME                    |REMARKS
 MINICRM             |COMPANY                       |
 MINICRM             |COMPANY_FIGURES               |
 MINICRM             |CRM_SEQ                       |
 ij> describe;
 COMPANY_NR          |DECIMAL  |0   |10  |5     |NULL      |NULL      |NO
 SHORT_NAME          |VARCHAR  |NULL|NULL|60    |NULL      |120       |NO

This is how you might have added the missing column:

ALTER TABLE ADD COLUMN my_new_column int;


 ij> disconnect;
 ij> exit;

Copyright © Eclipse Foundation, Inc. All Rights Reserved.