Setting up the environment
In this section, you perform the following tasks:
- Install Community Edition v184.108.40.206
- Create the EMPLOYEE_DB database in the embedded derby database.
- Deploy the EMPLOYEE_DS data source on the EMPLOYEE_DB database.
The Community Edition installer is available for download from
Download the server to your machine and follow the instructions in the
Community Edition v2.1
In this tutorial, we refer to the Community Edition installation
The Community Edition installer ships the IBM Java SDK1.5.0. This JDK
is used by the installer as well as the server run time. For more
information about the recommended and compatible platforms, see the
- Start the Community Edition server and open the Web administration console by pointing the browser window to http://localhost:8080/console
- Log into the administration console by providing
systemas the user name and
manageras the password.
- On the left hand side of the administration console, in the
Console Navigation portlet, click on the DB
Manager link to open up DB Viewer and Run
SQL portlets on the right side, as Figure 1 shows:
Figure 1. DB Viewer and Run SQL portlets communication
- On the Run SQL portlet, enter
EMPLOYEE_DBin the Create DB textbox and click on the Create button, which will create an EMPLOYEE_DB database in the embedded Derby database. After it’s created, the Database List portlet lists the EMPLOYEE_DB database, as Figure 2 shows.
Figure 2. EMPLOYEE_DB in DB Viewer portlet
- Click on Application link for the EMPLOYEE_DB
database to show a list of application tables created in the
database. Currently, no application tables exist in the database.
In the SQL Command/s text area, enter the SQL statement in
Listing 1 to create the EMPLOYEE table in the database:
Listing 1. SQL statement to create a table
create table EMPLOYEE (EMPNO int, ENAME varchar(50), JOB varchar(10), MGR varchar(10), SAL decimal(15,2), COMM decimal(15,2), DEPTNO int);
- Similarly, insert some sample rows in the database using the
below SQL statements.
Listing 2. SQL statement to insert rows
insert into EMPLOYEE values (1, 'PHANI', 'SSE', 'NIKHIL', 10000, 15, 100); insert into EMPLOYEE values (2, 'JOE', 'SSE', 'NIKHIL', 12000, 15, 100); insert into EMPLOYEE values (3, 'JOHN', 'SSE', 'BOB', 13000, 15, 200);
- Finally, the table should look like Figure 3:
Figure 3. Final EMPLOYEE_DB table
- Click Database Pools in the Console Navigation portlet on the administration console. This step opens the Database Pools portlet, which lists the database pools currently deployed on the server.
- Click Using the Geronimo database pool wizard to create a
new database pool. Enter
EMPLOYEE_DSin the Name of the Database Pool field and select Derby embedded in the Database Type combo box as shown in Figure 4. Click Next.
Figure 4. Creating the Database Pool
- On the next screen, enter
EMPLOYEE_DBin the Database Name field (Figure 5). Select the single entry in the Driver JAR box and click Deploy at the bottom of the page. This step deploys the EMPLOYEE_DS database pool. The Database pools portlet now shows the newly created database pool.
Figure 5. Configuring the Database Pool