Skip to main content

skip to main content

developerWorks  >  WebSphere | Open source  >

Application logging in WebSphere Application Server Community Edition

Using java.util.logging, Log4j and SLF4j

developerWorks
Go to the previous pagePage 2 of 10 Go to the next page

Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
349 KB (29 pages)

Get Adobe® Reader®

Sample code


My developerWorks needs you!

Connect to your technical community


Rate this tutorial

Help us improve this content


Setting up the environment

In this section, you perform the following tasks:

  • Install Community Edition v2.1.0.1
  • Create the EMPLOYEE_DB database in the embedded derby database.
  • Deploy the EMPLOYEE_DS data source on the EMPLOYEE_DB database.

Install Community Edition v2.1.0.1

The Community Edition installer is available for download from developerWorks. Download the server to your machine and follow the instructions in the Community Edition v2.1 documentation. In this tutorial, we refer to the Community Edition installation directory as <wasce_home>. 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 support site.



Back to top


Create EMPLOYEE_DB database in the embedded derby database

  1. Start the Community Edition server and open the Web administration console by pointing the browser window to http://localhost:8080/console
  2. Log into the administration console by providing system as the user name and manager as the password.
  3. 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
    Screen shot of DB Viewer and Run SQL     portlets

  4. On the Run SQL portlet, enter EMPLOYEE_DB in 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
    Screen shot of EMPLOYEE_DB in DB Viewer     portlet

  5. 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);

  6. 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);

  7. Finally, the table should look like Figure 3:

    Figure 3. Final EMPLOYEE_DB table
    Screen shot of Final EMPLOYEE_DB table



Back to top


Deploy the EMPLOYEE_DS data source on the EMPLOYEE_DB database

  1. 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.
  2. Click Using the Geronimo database pool wizard to create a new database pool. Enter EMPLOYEE_DS in 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
    Screen shot of creating the Database Pool

  3. On the next screen, enter EMPLOYEE_DB in 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
    Screen shot of configuring the Database Pool



Back to top



Go to the previous pagePage 2 of 10 Go to the next page