Lotus Expeditor Toolkit, Version 6.1.x
Operating systems: Linux on x86, Windows

Derby sample

This sample illustrates the use of the local Derby database.

You can use this sample only on the desktop runtime.

Time requested: 2 minutes

This sample consists of a single Client Services project, com.ibm.rcp.samples.derby. Key concepts demonstrated in this sample are as follows:
  • Creation of a Derby DataSource object
  • Creation of a database within the current workspace
  • Creation of a database using SQL specified in the Java™ code
  • Use of PreparedStatement objects to execute SQL statements

For additional information about this sample, refer to the Java class in the com.ibm.rcp.samples.derby package.

Setup instructions

Before you can run the sample, you must first import the sample into your workspace and launch the test runtime.
  1. To import the sample:
    1. Select File > Import.
    2. From the Import Wizard, select General and then select Existing Projects into Workspace. Click Next.
    3. Select the Archive file radio button.
    4. Enter the name of the sample jar file, derby.jar, or browse to the com.ibm.rcp.tools.samplegallery plug-in directory and select the jar file from the archive directory.
    5. The dialog shows the projects present in the archive jar file. Select Finish to install the projects into your workspace.
  2. To configure and run the sample:
    1. Select Run > Run from the main menu.
    2. Select Client Services and click New.
    3. Type a unique name for your configuration, such as Derby.
    4. Select the Plug-ins tab and verify that the com.ibm.rcp.samples.derby plug-in is selected.
    5. Select the Arguments tab and verify that –console is in the Program Arguments field.
    6. Click Apply and then Run.
  3. To start the sample, enter start com.ibm.rcp.samples.derby in the Console view.
osgi> start com.ibm.rcp.samples.derby

   osgi> ***Created table: dish
   ***Inserted three records into table: dish
   ***Selected records from table: dish
   Dish NO.=1111, Dish Name=Noodle, Dish Price=12.25
   Dish NO.=2222, Dish Name=Fish, Dish Price=32.24
   Dish NO.=3333, Dish Name=Pizza, Dish Price=25.32
   ***Deleted table: dish

Troubleshooting

Problem:
When attempting to run the start com.ibm.rcp.samples.derby command in the console, the following message is displayed:
Cannot find bundle com.ibm.rcp.samples.derby
Cause:
The com.ibm.rcp.tools.samples.derby bundle is not available in your runtime.
Action:
Edit your launch configuration and verify that the com.ibm.rcp.samples.derby bundle is selected.
Problem:
When attempting to run the start com.ibm.rcp.samples.derby command in the console, the following message is displayed:
org.osgi.framework.BundleException: The bundle could not be resolved. 
Reason: Missing Constraint: Require-Bundle: org.apache.derby.core; 
bundle-version="0.0.0"
Cause:
The org.apache.derby.core bundle is not available in the runtime.
Action:
Edit your launch configuration and verify that the org.apache.derby.core bundle is selected.


Library | Support | Terms of use |

Last updated: April 21, 2008
(C) Copyright IBM Corporation 2004, 2008. All Rights Reserved.
This information center is built on Eclipse. (http://www.eclipse.org)