Many of the WebSphere samples demonstrate database
access. Before you can use these samples, you must have a DB2 database
and configure it for both the WebSphere Application Server and these
samples. Just follow these
steps and let our database servlet do most of the work for you.
Procedure for configuring the database samples:
- Install IBM DB2 and create the DB2 SAMPLE database
(follow instructions in the DB2 documentation for doing this).
- Create a wsdemo user:
- Create a system user named wsdemo
with password wsdemo1.
- Create a DB2 user named wsdemo
for the SAMPLE database.
See the technical details for
more information.
- Run
the database servlet to setup the tables in the DB2 SAMPLE database
and create aliases. Enter the following data and click Submit:
User/Password: Enter your username and password. The new database
tables are created under this username.
Database URL: Enter the location of the SAMPLE database. If
DB2 is running on the same machine as WebSphere Application Server,
keep the default setting of jdbc:db2:SAMPLE. If your database is running
elsewhere, enter the appropriate URL.
Database Driver Since you are connecting to a DB2 database,
use COM.ibm.db2.jdbc.app.DB2Driver, the default setting.
Poll question: Enter a question for the
Poll sample. It must take a Yes or No answer. Examples: "Did
you vote in the last national election?", "Have you hugged
your computer today?".
Technical details about the wsdemo user
- Be sure you use ALL LOWER-CASE letters when creating
the wsdemo user.
- Accept the default authority for the DB2 wsdemo
user.
- When you run the database servlet, login in with
your normal DB2 administrator userid.
- The database servlet will:
- Create additional tables in the DB2 SAMPLE database
using your DB2 administrator userid.
- Create aliases to the DB2 SAMPLE database using
the wsdemo userid.
- Grant additional authority to the DB2 wsdemo
user.
|