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.
- 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.
- Enter weblogic as the username and password, then click Sign In.
- In the left pane, open the Servers node.
- Right-click MedRecServer and choose Start/Stop This Server.
- In the right pane, click Graceful shutdown of this server.
- 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.
- Open a command prompt window.
- 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.
- 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
- Open a command prompt window.
- 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.
- Start the Pointbase database by executing the following command:
startPointBase.cmd
- 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
- From the Windows Start menu, choose:
Start—>Programs—>BEA—>WebLogic Platform 8.0—>User Projects—>MedRecDomain—>Start Server
- As the server starts, the system prompts you to enter a username to start the server. Enter weblogic and click Enter.
- 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.
- 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:
- 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
- Invoke the startPointBaseConsole.cmd command to launch the PointBase console:
startPointBaseConsole.cmd
This command also sets the CLASSPATH to find the PointBase JAR files.
- Enter com.pointbase.jdbc.jdbcUniversalDriver in the Driver field.
- Enter jdbc:pointbase:server://localhost/demo in the URL field.
- Enter MedRec in the User field.
- Enter MedRec in the Password field.
- Click OK.
- In the left pane, choose Schemas—>Medrec
- Browse the tables, triggers, views, and procedures that make up the Medrec database.
Best Practices
bea_home\weblogic800\samples\server\eval\pointbase\tools
where bea_home refers to the main BEA home directory, typically c:\bea.
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
|
Copyright © 2002 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
|