Configuring Domains and Servers

Tutorial 2: Configuring and Starting the Pointbase Development Database

This tutorial describes how to configure the Pointbase database management system with WebLogic Server so that the MedRec application can use it to store application data.

In particular, the tutorial shows how to:

Note: The installation of Pointbase shipped with WebLogic Server is already set up with the database tables and data used by the MedRec application. For information on viewing the already-created tables, see Step 5: Use the Pointbase Console to View the MedRec Tables and Data.

The tutorial includes the following sections:

 

 

 

Prerequisites

Before starting this tutorial:

 

 

 

Procedure

Follow these steps to configure Pointbase:

Step 1: Shut down MedRecServer (if currently running)

You must shut down the MedRecServer because you edit its start script to update the CLASSPATH variable of the server.

If the MedRecServer is not currently running, go to Step 2: Add the Pointbase JDBC Driver Class to the MedRecServer CLASSPATH.

  1. Invoke the Administration Console by entering the following URL in your browser:
    http://host:7101/console
    

    where host is the computer on which you have installed the MedRec domains and servers.

  2. Enter weblogic as the username and password, then click Sign In.

  3. In the left pane, open the Servers node.

  4. Right-click MedRecServer and choose Start/Stop This Server.

  5. In the right pane, click Graceful shutdown of this server.

  6. Click Yes.

Step 2: Add the Pointbase JDBC Driver Class to the MedRecServer CLASSPATH

The MedRecServer server needs to have the Pointbase JDBC driver class added to its CLASSPATH variable before it can connect to the database used by the MedRec application. You update the WebLogic Server CLASSPATH variable by editing the script that starts the MedRecServer server, as described in the following procedure.

Note: Only the applications running on the MedRecServer use the Pointbase database, which is why this tutorial does not describe how to add the Pointbase JDBC driver class to the PhysicianServer's CLASSPATH.

  1. Open a command prompt window.

  2. Change to MedRecDomain domain directory.

    The MedRecDomain directory is bea_home\user_projects\MedRecDomain, where bea_home if where BEA WebLogic Platform is installed. This directory typically c:\bea.

  3. In the startWebLogic.cmd and setEnv.cmd files, add the following lines:
    @rem add Pointbase information
    
    set SAMPLES_HOME=bea_home\weblogic800\samples
    set POINTBASE_HOME=%SAMPLES_HOME%\server\eval\pointbase
    set 
    CLASSPATH=%POINTBASE_HOME%\lib\pbserver43.jar;%POINTBASE_HOME%\
    lib\pbclient43.jar
    

    replacing bea_home with the main BEA home directory, typically c:\bea.

Step 3: Start the Pointbase Database

  1. Open a command prompt window.

  2. Change to the Pointbase tools directory:
    cd bea_home\weblogic800\samples\server\eval\pointbase\tools
    

    where bea_home refers to the main BEA home directory, typically c:\bea.

  3. Start the Pointbase database by executing the following command:
    startPointBase.cmd
    

  4. Leave this command window open for as long as you want the Pointbase database running. If you close the window, the Pointbase database will shut down.

Step 4: Restart the MedRec Server

  1. From the Windows Start menu, choose:

    Start—>Programs—>BEA—>WebLogic Platform 8.0—>User Projects—>MedRecDomain—>Start Server

  2. As the server starts, the system prompts you to enter a username to start the server. Enter weblogic and click Enter.

  3. The system also prompts you to enter the password for the administrative user. Enter weblogic and click Enter.

Step 5: Use the Pointbase Console to View the MedRec Tables and Data

The installation of Pointbase shipped with WebLogic Server is already set up with the database tables and data used by the MedRec application. To view these already-created tables, use the Pointbase Console.

  1. Launch the PointBase console:

    From the Start menu:

    Start—>Programs—>BEA—>WebLogic Platform 8.0—>WebLogic Server 8.0—>Server Tour and Examples—>Pointbase Console

    From a script:

    1. In a command-line shell, go to the bea_home\weblogic800\samples\server\eval\pointbase\tools directory where bea_home is the main BEA home directory, typically c:\bea. For example, enter the following command:
      cd c:\bea\weblogic800\samples\server\eval\pointbase\tools
      

    2. Invoke the startPointBaseConsole.cmd command to launch the PointBase console:
      startPointBaseConsole.cmd
      

      This command also sets the CLASSPATH to find the PointBase JAR files.

  2. Enter com.pointbase.jdbc.jdbcUniversalDriver in the Driver field.

  3. Enter jdbc:pointbase:server://localhost/demo in the URL field.

  4. Enter MedRec in the User field.

  5. Enter MedRec in the Password field.

  6. Click OK.

  7. In the left pane, choose Schemas—>Medrec

  8. Browse the tables, triggers, views, and procedures that make up the Medrec database.

 

 

 

Best Practices

 

 

 

The Big Picture

The MedRec application uses the Pointbase database management system:

Patient, Physician, and Administrator Data

The MedRec application uses container-managed entity EJBs to automatically persist information about patients, physicians, and administrators in the Pointbase database. The following table lists these entity EJBs and the Pointbase tables in which the information is persisted.

Table 1-1 Relationship Between MedRec Entity EJBs and Pointbase Tables

Entity EJB

Application That Uses the EJB

Corresponding Pointbase Table

Description

AdminEJB

Administration

ADMIN

Information about the administrators that manage the workflow of the MedRec application. Administrators handle patient requests.

AddressEJB

Administration, Patient

ADDRESS

Used by the PATIENT, PHYSICIAN, and ADMIN tables to store their respective addresses.

PatientEJB

Administration, Patient

PATIENT

Information about patients, such as name, address reference to the ADDRESS table, SSN, and so on.

PhysicianEJB

Administration

PHYSICIAN

Information about physicians, such as name, address reference to the ADDRESS table, phone, and email.

PrescriptionEJB

Patient

PRESCRIPTION

Describes a prescription, such as the prescribed drug, the dosage, frequency, instructions, and so on. Also includes the patient ID, the ID of the prescribing physician, and the particular visit that instigated the prescription.

RecordEJB

Patient

RECORD

Describes a single patient visit to a physician. Includes the patient ID, the physician ID, the date, the symptoms, diagnosis, and the vital signs of the patient.

UserEJB

Administration, Patient, Physician

USER

Lists all users (patients, physicians, and administrators) who are authorized to log into the MedRec application. After a user is authenticated, the application retrieves additional information from the appropriate table (PATIENT, PHYSICIAN, OR ADMIN).

VitalSignsEJB

Patient

VITALSIGNS

Describes the vital signs of a patient for a particular visit. Vital signs include temperature, blood pressure, height, weight, and so on.

Persistent JMS Message Storage

The MedRec application uses persistent JMS messaging, which means that any JMS messages that are put in a queue are also stored in a database so that the messages can be retrieved in case a problem occurs (such as a server crash) before the message-driven bean is able to process them. The messages are stored in the following two Pointbase tables:

These tables are generated automatically when you create the JMS JDBC store using the Administration Console and are used internally by JMS.

 

 

 

Related Reading

 

back to top